Skip to content

Commit

Permalink
arm: setjmp/longjmp: fix PIC vs SHARED thinkos
Browse files Browse the repository at this point in the history
The logic in setjmp/__longjmp incorrectly uses "PIC" to figure out
whether the code is going into a shared library when it should be
using "SHARED".  If you build glibc with a gcc version that has PIE
enabled by default, then the code will try to use symbols that are
only in the shared library.

URL: https://bugs.gentoo.org/336914
  • Loading branch information
David Lamparter authored and Mike Frysinger committed Sep 18, 2015
1 parent 020167a commit 3ee5786
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2015-09-18 David Lamparter <equinox-gentoo@diac24.net>

* sysdeps/arm/setjmp.S: Change PIC to SHARED.
* sysdeps/arm/__longjmp.S: Likewise

2015-09-18 Wilco Dijkstra <wdijkstr@arm.com>

* sysdeps/ieee754/dbl-64/s_signbit.c (__signbit):
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/arm/__longjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ENTRY (__longjmp)
C_SYMBOL_NAME(_rtld_local_ro) \
+ RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
# ifdef PIC
# ifdef SHARED
LDR_GLOBAL (a4, a3, C_SYMBOL_NAME(_rtld_global_ro), \
RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
Expand Down
2 changes: 1 addition & 1 deletion sysdeps/arm/setjmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ENTRY (__sigsetjmp)
C_SYMBOL_NAME(_rtld_local_ro) \
+ RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
# ifdef PIC
# ifdef SHARED
LDR_GLOBAL (a3, a4, C_SYMBOL_NAME(_rtld_global_ro), \
RTLD_GLOBAL_RO_DL_HWCAP_OFFSET)
# else
Expand Down

0 comments on commit 3ee5786

Please sign in to comment.