diff options
author | Guy Martin <gmsoft@tuxicoman.be> | 2013-11-21 13:23:16 -0500 |
---|---|---|
committer | Carlos O'Donell <carlos@redhat.com> | 2013-11-21 15:52:31 -0500 |
commit | daf75146de07303ea0c5ad700ec5ef703ec114a1 (patch) | |
tree | ed307e39a90288cbcdf727a7c07addb9f38f65d8 /ports/sysdeps/ia64/dl-machine.h | |
parent | d33cafadfe365befa4ca6e0463fa926d56144046 (diff) | |
download | glibc-daf75146de07303ea0c5ad700ec5ef703ec114a1.zip glibc-daf75146de07303ea0c5ad700ec5ef703ec114a1.tar.gz glibc-daf75146de07303ea0c5ad700ec5ef703ec114a1.tar.bz2 |
Don't use broken DL_AUTO_FUNCTION_ADDRESS()
On hppa and ia64, the macro DL_AUTO_FUNCTION_ADDRESS() uses the
variable fptr[2] in it's own scope.
The content of fptr[] is thus undefined right after the macro exits.
Newer gcc's (>= 4.7) reuse the stack space of this variable triggering
a segmentation fault in dl-init.c:69.
To fix this we rewrite the macros to make the call directly to init
and fini without needing to pass back a constructed function pointer.
Diffstat (limited to 'ports/sysdeps/ia64/dl-machine.h')
-rw-r--r-- | ports/sysdeps/ia64/dl-machine.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ports/sysdeps/ia64/dl-machine.h b/ports/sysdeps/ia64/dl-machine.h index dd469d7..6123637 100644 --- a/ports/sysdeps/ia64/dl-machine.h +++ b/ports/sysdeps/ia64/dl-machine.h @@ -322,8 +322,12 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) #define ELF_MACHINE_NO_REL 1 /* Return the address of the entry point. */ -#define ELF_MACHINE_START_ADDRESS(map, start) \ - DL_STATIC_FUNCTION_ADDRESS (map, start) +#define ELF_MACHINE_START_ADDRESS(map, start) \ +({ \ + ElfW(Addr) addr; \ + DL_DT_FUNCTION_ADDRESS(map, start, static, addr) \ + addr; \ +}) /* Fixup a PLT entry to bounce directly to the function at VALUE. */ static inline struct fdesc __attribute__ ((always_inline)) |