summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-10-12 20:46:00 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2019-10-12 21:03:04 +0100
commit09b83ce882607cd545070a6c1ac9dd87f7143464 (patch)
treeb6fdb838d9f4f6b9775711c0182eba08b5886be6 /sys-libs
parentsys-auth/nss-pam-ldapd: migrate to sys-libs/pam (diff)
downloadgentoo-09b83ce882607cd545070a6c1ac9dd87f7143464.tar.gz
gentoo-09b83ce882607cd545070a6c1ac9dd87f7143464.tar.bz2
gentoo-09b83ce882607cd545070a6c1ac9dd87f7143464.zip
sys-libs/glibc: restore used glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
glibc-2.19-ia64-gcc-4.8-reloc-hack.patch is used at least by glibc-2.24 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
new file mode 100644
index 000000000000..72a616a046a8
--- /dev/null
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/503838
+http://gcc.gnu.org/PR60465
+https://sourceware.org/ml/libc-alpha/2015-12/msg00556.html
+https://trofi.github.io/posts/189-glibc-on-ia64-or-how-relocations-bootstrap.html
+
+newer versions of gcc generate relocations in the elf_get_dynamic_info func
+which glibc relies on to populate some info structs. those structs are then
+used by ldso to process relocations in itself. glibc requires that there are
+no relocations until that point (*after* elf_get_dynamic_info), so we end up
+crashing during elf_get_dynamic_info because the relocation has not yet been
+processed.
+
+this hack shuffles the code in a way that tricks gcc into not generating the
+relocation. we need to figure out something better for upstream.
+
+--- a/elf/get-dynamic-info.h
++++ b/elf/get-dynamic-info.h
+@@ -66,8 +66,12 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
+ info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+ + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn;
+ else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM)
+- info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
+- + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn;
++ {
++ d_tag_utype i =
++ DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM
++ + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM;
++ info[i] = dyn;
++ }
+ ++dyn;
+ }
+