mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-25 04:01:10 +00:00
arm: Guard ucontext _rtld_global_ro access by SHARED, not PIC macro
Due to PIE-by-default, PIC is now defined in more cases. libc.a
does not have _rtld_global_ro, and statically linking setcontext
fails. SHARED is the right condition to use, so that libc.a
references _dl_hwcap instead of _rtld_global_ro.
For static PIE support, the !SHARED case would still have to be made
PIC. This patch does not achieve that.
Fixes commit 23645707f1
("Replace --enable-static-pie with --disable-default-pie").
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
This commit is contained in:
parent
72e4a717bd
commit
ce1e5b1122
@ -50,7 +50,7 @@ ENTRY(__getcontext)
|
|||||||
|
|
||||||
/* Store FP regs. Much of the FP code is copied from arm/setjmp.S. */
|
/* Store FP regs. Much of the FP code is copied from arm/setjmp.S. */
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef SHARED
|
||||||
ldr r2, 1f
|
ldr r2, 1f
|
||||||
ldr r1, .Lrtld_global_ro
|
ldr r1, .Lrtld_global_ro
|
||||||
0: add r2, pc, r2
|
0: add r2, pc, r2
|
||||||
@ -102,7 +102,7 @@ ENTRY(__getcontext)
|
|||||||
|
|
||||||
END(__getcontext)
|
END(__getcontext)
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef SHARED
|
||||||
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
|
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
|
||||||
.Lrtld_global_ro:
|
.Lrtld_global_ro:
|
||||||
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
|
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
|
||||||
|
@ -32,7 +32,7 @@ ENTRY(__setcontext)
|
|||||||
add r0, r0, #UCONTEXT_REGSPACE
|
add r0, r0, #UCONTEXT_REGSPACE
|
||||||
|
|
||||||
/* Restore the VFP registers. Copied from arm/__longjmp.S. */
|
/* Restore the VFP registers. Copied from arm/__longjmp.S. */
|
||||||
#ifdef PIC
|
#ifdef SHARED
|
||||||
ldr r2, 1f
|
ldr r2, 1f
|
||||||
ldr r1, .Lrtld_global_ro
|
ldr r1, .Lrtld_global_ro
|
||||||
0: add r2, pc, r2
|
0: add r2, pc, r2
|
||||||
@ -101,7 +101,7 @@ ENTRY(__startcontext)
|
|||||||
.fnend
|
.fnend
|
||||||
END(__startcontext)
|
END(__startcontext)
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef SHARED
|
||||||
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
|
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
|
||||||
.Lrtld_global_ro:
|
.Lrtld_global_ro:
|
||||||
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
|
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
|
||||||
|
Loading…
Reference in New Issue
Block a user