Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2003-12-17  Carlos O'Donell  <carlos@baldric.uwo.ca>

	* sysdeps/hppa/fpu/fclrexcpt.c (feclearexcept): Right shift
	FE_ALL_EXCEPT before complimenting.
	* sysdeps/hppa/fpu/fegetenv.c (fegetenv): Use asm 'ma,' completer,
	and gcc '+r' constraint.
	* sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Likewise.
	* sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise.
	* sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Read raised
	exception bits, OR with envp, pass to fesetenv.
	* sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Add delayed
	exception flushing, FE_UNDERFLOW is DBL_MIN/3.0, FE_INEXACT is
	triggered by M_PI/69.69 converted to single precision.
	* sysdeps/hppa/fpu/fsetexcptflg.c (fesetexceptflag): Set enable
	bits not raised exception bits.

	* sysdeps/hppa/Makefile: Add dl-symaddr and dl-fptr to the
	correct build strings.
	* sysdeps/hppa/dl-fptr.h: New file.
	* sysdeps/hppa/dl-fptr.c: Removed.
	* sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Use _dl_make_ftpr,
	remove const qualifier for map.
	(_dl_function_address): Removed.
	* sysdeps/hppa/dl-lookupcfg.h: DL_LOOKUP_ADDRESS must clear
	PLABEL32 bits, define DL_AUTO_FUNCTION_ADDRESS and
	DL_STATIC_FUNCTION_ADDRESS, DL_DT_INIT_ADDRESS and
	DL_DT_FINI_ADDRESS use the previous two macros.

	* misc/mntent_r.c: Change encoding to match recently changed decoder.
  • Loading branch information
Ulrich Drepper committed Dec 18, 2003
1 parent 4ae4fac commit 592f26a
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 306 deletions.
30 changes: 29 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
2003-12-17 Carlos O'Donell <carlos@baldric.uwo.ca>

* sysdeps/hppa/fpu/fclrexcpt.c (feclearexcept): Right shift
FE_ALL_EXCEPT before complimenting.
* sysdeps/hppa/fpu/fegetenv.c (fegetenv): Use asm 'ma,' completer,
and gcc '+r' constraint.
* sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Likewise.
* sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise.
* sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Read raised
exception bits, OR with envp, pass to fesetenv.
* sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Add delayed
exception flushing, FE_UNDERFLOW is DBL_MIN/3.0, FE_INEXACT is
triggered by M_PI/69.69 converted to single precision.
* sysdeps/hppa/fpu/fsetexcptflg.c (fesetexceptflag): Set enable
bits not raised exception bits.

* sysdeps/hppa/Makefile: Add dl-symaddr and dl-fptr to the
correct build strings.
* sysdeps/hppa/dl-fptr.h: New file.
* sysdeps/hppa/dl-fptr.c: Removed.
* sysdeps/hppa/dl-symaddr.c (_dl_symbol_address): Use _dl_make_ftpr,
remove const qualifier for map.
(_dl_function_address): Removed.
* sysdeps/hppa/dl-lookupcfg.h: DL_LOOKUP_ADDRESS must clear
PLABEL32 bits, define DL_AUTO_FUNCTION_ADDRESS and
DL_STATIC_FUNCTION_ADDRESS, DL_DT_INIT_ADDRESS and
DL_DT_FINI_ADDRESS use the previous two macros.

2003-12-17 Jakub Jelinek <jakub@redhat.com>

* malloc/mtrace.c (tr_old_memalign_hook): New variable.
Expand All @@ -9,7 +37,7 @@

2003-12-17 Ulrich Drepper <drepper@redhat.com>

* misc/mntent_r.c: Change encoding to match recently change decoder.
* misc/mntent_r.c: Change encoding to match recently changed decoder.
Patch by Alexander Achenbach <xela@slit.de>.

2003-12-16 Steven Munroe <sjmunroe@us.ibm.com>
Expand Down
211 changes: 0 additions & 211 deletions sysdeps/hppa/dl-fptr.c

This file was deleted.

35 changes: 35 additions & 0 deletions sysdeps/hppa/dl-fptr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Function descriptors. HPPA version.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#ifndef dl_hppa_fptr_h
#define dl_hppa_fptr_h 1

#include <sysdeps/generic/dl-fptr.h>

/* There are currently 20 dynamic symbols in ld.so.
ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big. */
#define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 200

#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
asm (" addil LT%%" #symbol ", %%r19\n" \
" ldw RT%%" #symbol "(%%sr0,%%r1), %0\n" \
: "=&r" (var));


#endif /* !dl_hppa_fptr_h */
33 changes: 25 additions & 8 deletions sysdeps/hppa/dl-lookupcfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,44 @@
/* Forward declaration. */
struct link_map;

void *_dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref);
void *_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref);

#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref)

Elf32_Addr _dl_lookup_address (const void *address);

#define DL_LOOKUP_ADDRESS(addr) _dl_lookup_address (addr)
/* Clear the bottom two bits so generic code can find the fdesc entry */
#define DL_LOOKUP_ADDRESS(addr) \
(_dl_lookup_address ((void *)((unsigned long)addr & ~3)))

void _dl_unmap (struct link_map *map);

#define DL_UNMAP(map) _dl_unmap (map)

extern Elf32_Addr _dl_function_address (const struct link_map *map,
Elf32_Addr start);
#define DL_AUTO_FUNCTION_ADDRESS(map, addr) \
({ \
unsigned int fptr[2]; \
fptr[0] = (unsigned int) (addr); \
fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
/* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \
(ElfW(Addr))((unsigned int)fptr | 2); \
})

#define DL_STATIC_FUNCTION_ADDRESS(map, addr) \
({ \
static unsigned int fptr[2]; \
fptr[0] = (unsigned int) (addr); \
fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
/* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \
(ElfW(Addr))((unsigned int)fptr | 2); \
})

#define DL_FUNCTION_ADDRESS(map, addr) _dl_function_address (map, addr)

/* The test for "addr & 2" below is to accomodate old binaries which
violated the ELF ABI by pointing DT_INIT and DT_FINI at a function
pointer. */
descriptor. */
#define DL_DT_INIT_ADDRESS(map, addr) \
((Elf32_Addr)(addr) & 2 ? (addr) : DL_FUNCTION_ADDRESS (map, addr))
((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr))
#define DL_DT_FINI_ADDRESS(map, addr) \
((Elf32_Addr)(addr) & 2 ? (addr) : DL_FUNCTION_ADDRESS (map, addr))
((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr))

17 changes: 7 additions & 10 deletions sysdeps/hppa/dl-symaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,16 @@
#include <dl-machine.h>

void *
_dl_symbol_address (const struct link_map *map, const ElfW(Sym) *ref)
_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref)
{
/* Find the "ip" from the "map" and symbol "ref" */
Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value;

/* On hppa, we have to return the pointer to function descriptor. */
if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC)
return (void *) __hppa_make_fptr (map, value, &__fptr_root, NULL);
/* On hppa, we have to return the pointer to function descriptor.
This involves an "| 2" to inform $$dyncall that this is a plabel32 */
if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC){
return (void *)((unsigned long)_dl_make_fptr (map, ref, value) | 2);
}
else
return (void *) value;
}

ElfW(Addr)
_dl_function_address (const struct link_map *map, ElfW(Addr) start)
{
return __hppa_make_fptr (map, start, &__fptr_root, NULL);
}
2 changes: 1 addition & 1 deletion sysdeps/hppa/fpu/fclrexcpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ feclearexcept (int excepts)
__asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));

/* Clear all the relevant bits. */
sw[0] &= ~(excepts & FE_ALL_EXCEPT) << 27;
sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);
__asm__ ("fldd 0(%0),%%fr0" : : "r" (sw));

/* Success. */
Expand Down
10 changes: 5 additions & 5 deletions sysdeps/hppa/fpu/fegetenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ int
fegetenv (fenv_t *envp)
{
__asm__ (
"fstd %%fr0,0(%2)\n"
"fstd,ma %%fr1,8(%2)\n"
"fstd,ma %%fr2,8(%2)\n"
"fstd %%fr3,0(%2)\n"
: "=m" (*envp), "=r" (envp) : "1" (envp));
"fstd,ma %%fr0,8(%1)\n"
"fstd,ma %%fr1,8(%1)\n"
"fstd,ma %%fr2,8(%1)\n"
"fstd %%fr3,0(%1)\n"
: "=m" (*envp), "+r" (envp));
return 0;
}
Loading

0 comments on commit 592f26a

Please sign in to comment.