Start mass upgrade
[dragora.git] / patches / binutils / 2.35 / binutils-2.29-revert-PLT-elision.patch
blob746a551890bf7e50d4f444dd9f6ea4d448aec375
1 diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d
2 --- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000
3 +++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000
4 @@ -2,6 +2,7 @@
5 #readelf: -S --wide
6 #as: --32
8 +#pass
9 #...
10 +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
11 #...
12 diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d
13 --- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000
14 +++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000
15 @@ -3,7 +3,6 @@
16 #readelf: -d --wide
17 #as: --32
19 -#failif
20 #...
21 +0x[0-9a-f]+ +\(PLTREL.*
22 #...
23 diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d
24 --- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000
25 +++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000
26 @@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
27 [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
28 [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
29 [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
31 +#...
32 Symbol table '\.dynsym' contains [0-9]+ entries:
33 +Num: +Value +Size Type +Bind +Vis +Ndx Name
34 #...
35 diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d
36 --- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000
37 +++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000
38 @@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
39 [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
40 [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
41 [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
43 +#...
44 Symbol table '\.dynsym' contains [0-9]+ entries:
45 +Num: +Value +Size Type +Bind +Vis +Ndx Name
46 #...
47 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d
48 --- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000
49 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000
50 @@ -2,8 +2,4 @@
51 #readelf: -S --wide
52 #as: --64
54 -#...
55 - +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
56 -#...
57 - +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.*
58 #pass
59 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d
60 --- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000
61 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000
62 @@ -3,7 +3,6 @@
63 #readelf: -d --wide
64 #as: --64
66 -#failif
67 #...
68 +0x[0-9a-f]+ +\(PLTREL.*
69 #...
70 diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd
71 --- binutils.orig/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 13:32:39.405064420 +0000
72 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main-bnd.dd 2017-11-15 15:06:53.694623801 +0000
73 @@ -1,7 +1,4 @@
74 -#...
75 -Disassembly of section .plt.got:
77 -[a-f0-9]+ <[a-z_]+@plt>:
78 -[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*>
79 +#...
80 [ ]*[a-f0-9]+: 90 nop
81 #pass
82 diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
83 --- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000
84 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000
85 @@ -1,4 +1,3 @@
86 -#failif
87 #...
88 [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
89 #...
90 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d
91 --- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000
92 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000
93 @@ -20,6 +20,7 @@ Contents of the .eh_frame section:
94 DW_CFA_offset: r16 \(rip\) at cfa-8
95 DW_CFA_nop
96 DW_CFA_nop
97 +#pass
99 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
100 DW_CFA_nop
101 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d
102 --- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000
103 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000
104 @@ -20,6 +20,7 @@ Contents of the .eh_frame section:
105 DW_CFA_offset: r16 \(rip\) at cfa-8
106 DW_CFA_nop
107 DW_CFA_nop
108 +#pass
110 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
111 DW_CFA_nop
112 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d
113 --- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000
114 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000
115 @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
116 DW_CFA_offset: r16 \(rip\) at cfa-8
117 DW_CFA_nop
118 DW_CFA_nop
120 +#pass
122 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
123 DW_CFA_nop
124 DW_CFA_nop
125 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d
126 --- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000
127 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000
128 @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
129 DW_CFA_offset: r16 \(rip\) at cfa-8
130 DW_CFA_nop
131 DW_CFA_nop
133 +#pass
135 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
136 DW_CFA_nop
137 DW_CFA_nop
138 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d
139 --- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000
140 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000
141 @@ -19,7 +19,8 @@ Contents of the .eh_frame section:
142 DW_CFA_offset: r16 \(rip\) at cfa-8
143 DW_CFA_nop
144 DW_CFA_nop
146 +#pass
148 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
149 DW_CFA_nop
150 DW_CFA_nop
151 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d
152 --- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000
153 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000
154 @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
155 DW_CFA_offset: r16 \(rip\) at cfa-8
156 DW_CFA_nop
157 DW_CFA_nop
159 +#pass
161 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
162 DW_CFA_nop
163 DW_CFA_nop
164 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d
165 --- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000
166 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000
167 @@ -19,6 +19,7 @@ Contents of the .eh_frame section:
168 DW_CFA_offset: r16 \(rip\) at cfa-8
169 DW_CFA_nop
170 DW_CFA_nop
171 +#pass
173 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
174 DW_CFA_nop
175 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d
176 --- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000
177 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000
178 @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
179 DW_CFA_offset: r16 \(rip\) at cfa-8
180 DW_CFA_nop
181 DW_CFA_nop
183 +#pass
185 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
186 DW_CFA_nop
187 DW_CFA_nop
188 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d
189 --- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000
190 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000
191 @@ -19,7 +19,8 @@ Contents of the .eh_frame section:
192 DW_CFA_offset: r16 \(rip\) at cfa-8
193 DW_CFA_nop
194 DW_CFA_nop
196 +#pass
198 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
199 DW_CFA_nop
200 DW_CFA_nop
201 diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d
202 --- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000
203 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000
204 @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
205 DW_CFA_offset: r16 \(rip\) at cfa-8
206 DW_CFA_nop
207 DW_CFA_nop
209 +#pass
211 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
212 DW_CFA_nop
213 DW_CFA_nop
214 diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
215 --- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000
216 +++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000
217 @@ -14,6 +14,7 @@ Section Headers:
218 +\[[ 0-9]+\] .dynsym +.*
219 +\[[ 0-9]+\] .dynstr +.*
220 +\[[ 0-9]+\] .rela.dyn +.*
221 +#pass
222 +\[[ 0-9]+\] .plt +.*
223 +\[[ 0-9]+\] .plt.got +.*
224 +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096
225 --- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000
226 +++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000
227 @@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
228 plt_entry_size = htab->plt.plt_entry_size;
230 resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
232 +#if 0
233 /* We can't use the GOT PLT if pointer equality is needed since
234 finish_dynamic_symbol won't clear symbol value and the dynamic
235 linker won't update the GOT slot. We will get into an infinite
236 @@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
237 /* Use the GOT PLT. */
238 eh->plt_got.refcount = 1;
241 +#endif
242 /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
243 here if it is defined and referenced in a non-shared object. */
244 if (h->type == STT_GNU_IFUNC
245 --- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100
246 +++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100
247 @@ -19,7 +19,7 @@ Contents of the .eh_frame section:
248 DW_CFA_offset: r8 \(eip\) at cfa-4
249 DW_CFA_nop
250 DW_CFA_nop
252 +#pass
253 0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133
254 DW_CFA_nop
255 DW_CFA_nop
256 --- binutils.orig/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 14:55:25.370646189 +0100
257 +++ binutils-2.35/ld/testsuite/ld-x86-64/plt-main-ibt.dd 2020-07-24 15:06:58.124189348 +0100
258 @@ -1,7 +1,3 @@
259 #...
260 -Disassembly of section .plt.got:
262 -[a-f0-9]+ <[_a-z]+@plt>:
263 [ ]*[a-f0-9]+: f3 0f 1e fa endbr64
264 -[ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*>
265 #pass