diff --git a/elf-revert-elf_machine_dynamic-BZ-29835.patch b/elf-revert-elf_machine_dynamic-BZ-29835.patch new file mode 100644 index 0000000000000000000000000000000000000000..22c0d3073659183d95ae5ed087daae5cc6b38e19 --- /dev/null +++ b/elf-revert-elf_machine_dynamic-BZ-29835.patch @@ -0,0 +1,57 @@ +From 62f5b9d856248ce057770a893bf4d7ef897a49c8 Mon Sep 17 00:00:00 2001 +From: linzhuorong +Date: Thu, 1 Dec 2022 15:47:55 +0800 +Subject: [PATCH] elf: revert elf_machine_dynamic [BZ #29835] + +Error compiling glibc multilib with --enable-static-pie option turned on + +The patch that caused the error: + +aarch64-Make-elf_machine_-load_address-dynamic-robus.patch +arm-Simplify-elf_machine_-load_address-dynamic.patch + +Signed-off-by: linzhuorong +--- + sysdeps/aarch64/dl-machine.h | 5 +++-- + sysdeps/arm/dl-machine.h | 7 ++++--- + 2 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h +index b0675ee0..79557f80 100644 +--- a/sysdeps/aarch64/dl-machine.h ++++ b/sysdeps/aarch64/dl-machine.h +@@ -51,8 +51,9 @@ elf_machine_load_address (void) + static inline ElfW(Addr) __attribute__ ((unused)) + elf_machine_dynamic (void) + { +- extern ElfW(Dyn) _DYNAMIC[] attribute_hidden; +- return (ElfW(Addr)) _DYNAMIC - elf_machine_load_address (); ++ /* Declaring this hidden ensures that a PC-relative reference is uesed. */ ++ extern const ElfW(Addr) _GLOBAL_OFFSET_TABLE_[] attribute_hidden; ++ return _GLOBAL_OFFSET_TABLE_[0]; + } + + /* Set up the loaded object described by L so its unrelocated PLT +diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h +index eb13cb8b..cec6d669 100644 +--- a/sysdeps/arm/dl-machine.h ++++ b/sysdeps/arm/dl-machine.h +@@ -46,11 +46,12 @@ elf_machine_load_address (void) + } + + /* Return the link-time address of _DYNAMIC. */ +-static inline ElfW(Addr) __attribute__ ((unused)) ++static inline Elf32_Addr __attribute__ ((unused)) + elf_machine_dynamic (void) + { +- extern ElfW(Dyn) _DYNAMIC[] attribute_hidden; +- return (ElfW(Addr)) _DYNAMIC - elf_machine_load_address (); ++ /* Declaring this hidden ensures that a PC-relative reference is uesed. */ ++ extern const Elf32_Addr _GLOBAL_OFFSET_TABLE_[] attribute_hidden; ++ return _GLOBAL_OFFSET_TABLE_[0]; + } + + /* Set up the loaded object described by L so its unrelocated PLT +-- +2.27.0 + diff --git a/glibc.spec b/glibc.spec index 6a27841f47c0cf0b1f378b9d75c880b4855f2024..6b49a3358c296f86ea7dfd58386d6fc16cf71c21 100644 --- a/glibc.spec +++ b/glibc.spec @@ -66,7 +66,7 @@ ############################################################################## Name: glibc Version: 2.34 -Release: 101 +Release: 102 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -262,6 +262,7 @@ Patch9018: 0002-elf-ld.so-add-testcase-for-ld.so-load-shared-object-.patch Patch9019: 0003-elf-ld.so-use-special-mmap-for-hugepage-to-get-symbo.patch Patch9020: malloc-use-__get_nprocs-replace-__get_nprocs_sched.patch Patch9021: x86-use-total-l3cache-for-non_temporal_threshold.patch +Patch9022: elf-revert-elf_machine_dynamic-BZ-29835.patch Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -1420,6 +1421,9 @@ fi %endif %changelog +* Thu Dec 1 2022 linzhuorong - 2.34-102 +- elf: revert elf_machine_dynamic BZ-29835 + * Tue Nov 29 2022 Lv Ying - 2.34-101 - elf: Fix alloca size in _dl_debug_vdprintf