forked from rpms/glibc
c2879fd933
* Thu Jan 13 2022 Florian Weimer <fweimer@redhat.com> - 2.34-18 - Backport optimized ELF dependency sorting algorithm (#2032647) * Thu Jan 13 2022 Florian Weimer <fweimer@redhat.com> - 2.34-17 - Sync with upstream branch release/2.34/master, commit 2fe2af88abd13ae5636881da2e26f461ecb7dfb5 - i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771) - Update syscall lists for Linux 5.15 - powerpc: Fix unrecognized instruction errors with recent GCC - timezone: test-case for BZ #28707 - timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707) - Fix subscript error with odd TZif file [BZ #28338] - AArch64: Check for SVE in ifuncs [BZ #28744] - intl/plural.y: Avoid conflicting declarations of yyerror and yylex - Linux: Fix 32-bit vDSO for clock_gettime on powerpc32 - linux: Add sparck brk implementation - Update sparc libm-test-ulps - Update hppa libm-test-ulps - riscv: align stack before calling _dl_init [BZ #28703] - riscv: align stack in clone [BZ #28702] - powerpc64[le]: Allocate extra stack frame on syscall.S - elf: Fix tst-cpu-features-cpuinfo for KVM guests on some AMD systems [BZ #28704] - nss: Use "files dns" as the default for the hosts database (bug 28700) - arm: Guard ucontext _rtld_global_ro access by SHARED, not PIC macro - mips: increase stack alignment in clone to match the ABI - mips: align stack in clone [BZ #28223] Resolves: #2032647 Resolves: #2033649
66 lines
2.2 KiB
Diff
66 lines
2.2 KiB
Diff
commit 93aabf891e96e93f100081ee07989c23d7107d17
|
|
Author: Florian Weimer <fweimer@redhat.com>
|
|
Date: Fri Dec 17 11:48:41 2021 +0100
|
|
|
|
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 23645707f12f2dd9d80b51effb2d9618a7b65565
|
|
("Replace --enable-static-pie with --disable-default-pie").
|
|
|
|
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
|
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
|
|
(cherry picked from commit ce1e5b11229f19820b86f8b19d651f16009552b0)
|
|
|
|
diff --git a/sysdeps/unix/sysv/linux/arm/getcontext.S b/sysdeps/unix/sysv/linux/arm/getcontext.S
|
|
index 3aa581c4da6d1166..11bfcbe5f53afc6e 100644
|
|
--- a/sysdeps/unix/sysv/linux/arm/getcontext.S
|
|
+++ b/sysdeps/unix/sysv/linux/arm/getcontext.S
|
|
@@ -50,7 +50,7 @@ ENTRY(__getcontext)
|
|
|
|
/* Store FP regs. Much of the FP code is copied from arm/setjmp.S. */
|
|
|
|
-#ifdef PIC
|
|
+#ifdef SHARED
|
|
ldr r2, 1f
|
|
ldr r1, .Lrtld_global_ro
|
|
0: add r2, pc, r2
|
|
@@ -102,7 +102,7 @@ ENTRY(__getcontext)
|
|
|
|
END(__getcontext)
|
|
|
|
-#ifdef PIC
|
|
+#ifdef SHARED
|
|
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
|
|
.Lrtld_global_ro:
|
|
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
|
|
diff --git a/sysdeps/unix/sysv/linux/arm/setcontext.S b/sysdeps/unix/sysv/linux/arm/setcontext.S
|
|
index 8be8beefea13883e..4c7c6e550944138c 100644
|
|
--- a/sysdeps/unix/sysv/linux/arm/setcontext.S
|
|
+++ b/sysdeps/unix/sysv/linux/arm/setcontext.S
|
|
@@ -32,7 +32,7 @@ ENTRY(__setcontext)
|
|
add r0, r0, #UCONTEXT_REGSPACE
|
|
|
|
/* Restore the VFP registers. Copied from arm/__longjmp.S. */
|
|
-#ifdef PIC
|
|
+#ifdef SHARED
|
|
ldr r2, 1f
|
|
ldr r1, .Lrtld_global_ro
|
|
0: add r2, pc, r2
|
|
@@ -101,7 +101,7 @@ ENTRY(__startcontext)
|
|
.fnend
|
|
END(__startcontext)
|
|
|
|
-#ifdef PIC
|
|
+#ifdef SHARED
|
|
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
|
|
.Lrtld_global_ro:
|
|
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
|