1 |
commit: 09b83ce882607cd545070a6c1ac9dd87f7143464 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 12 19:46:00 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 12 20:03:04 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09b83ce8 |
7 |
|
8 |
sys-libs/glibc: restore used glibc-2.19-ia64-gcc-4.8-reloc-hack.patch |
9 |
|
10 |
glibc-2.19-ia64-gcc-4.8-reloc-hack.patch is used at least by glibc-2.24 |
11 |
|
12 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
13 |
|
14 |
.../2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch | 32 ++++++++++++++++++++++ |
15 |
1 file changed, 32 insertions(+) |
16 |
|
17 |
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 |
18 |
new file mode 100644 |
19 |
index 00000000000..72a616a046a |
20 |
--- /dev/null |
21 |
+++ b/sys-libs/glibc/files/2.19/glibc-2.19-ia64-gcc-4.8-reloc-hack.patch |
22 |
@@ -0,0 +1,32 @@ |
23 |
+https://bugs.gentoo.org/503838 |
24 |
+http://gcc.gnu.org/PR60465 |
25 |
+https://sourceware.org/ml/libc-alpha/2015-12/msg00556.html |
26 |
+https://trofi.github.io/posts/189-glibc-on-ia64-or-how-relocations-bootstrap.html |
27 |
+ |
28 |
+newer versions of gcc generate relocations in the elf_get_dynamic_info func |
29 |
+which glibc relies on to populate some info structs. those structs are then |
30 |
+used by ldso to process relocations in itself. glibc requires that there are |
31 |
+no relocations until that point (*after* elf_get_dynamic_info), so we end up |
32 |
+crashing during elf_get_dynamic_info because the relocation has not yet been |
33 |
+processed. |
34 |
+ |
35 |
+this hack shuffles the code in a way that tricks gcc into not generating the |
36 |
+relocation. we need to figure out something better for upstream. |
37 |
+ |
38 |
+--- a/elf/get-dynamic-info.h |
39 |
++++ b/elf/get-dynamic-info.h |
40 |
+@@ -66,8 +66,12 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp) |
41 |
+ info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM |
42 |
+ + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn; |
43 |
+ else if ((d_tag_utype) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM) |
44 |
+- info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM |
45 |
+- + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn; |
46 |
++ { |
47 |
++ d_tag_utype i = |
48 |
++ DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM |
49 |
++ + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM; |
50 |
++ info[i] = dyn; |
51 |
++ } |
52 |
+ ++dyn; |
53 |
+ } |
54 |
+ |