]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - ld/testsuite/ld-x86-64/x86-64.exp
ld: Adjust x86 and x86-64 tests for -z mark-plt
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-x86-64 / x86-64.exp
1 # Expect script for ld-x86_64 tests
2 # Copyright (C) 2002-2024 Free Software Foundation, Inc.
3 #
4 # This file is part of the GNU Binutils.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 #
21
22 # Test x86_64 linking; all types of relocs. This tests the assembler and
23 # tools like objdump as well as the linker.
24
25 if { !([istarget "x86_64-*-elf*"] || [istarget "x86_64-*-linux*"]) } {
26 return
27 }
28
29 set emul "elf_x86_64"
30 set saved_ASFLAGS "$ASFLAGS"
31 set ASFLAGS "$ASFLAGS -mx86-used-note=no"
32
33 # List contains test-items with 3 items followed by 2 lists:
34 # 0:name 1:ld early options 2:ld late options 3:assembler options
35 # 4:filenames of assembler files 5: action and options. 6: name of output file
36
37 # Actions:
38 # objdump: Apply objdump options on result. Compare with regex (last arg).
39 # nm: Apply nm options on result. Compare with regex (last arg).
40 # readelf: Apply readelf options on result. Compare with regex (last arg).
41
42 set x86_64tests {
43 {"Helper shared library (basic PLT test)"
44 "-shared -melf_x86_64" "" "--64" {pltlib.s} {} "libpltlib.so"}
45 {"basic PLT generation"
46 "-melf_x86_64 tmpdir/libpltlib.so" "" "--64" {plt.s}
47 {{objdump -drj.plt plt.pd}} "plt"}
48 {"Helper shared library" "-shared -melf_x86_64" ""
49 "--64" {tlslib.s} {} "libtlslib.so"}
50 {"TLS -fpic and -fno-pic exec transitions"
51 "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info \
52 -z nomark-plt \
53 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv" ""
54 "--64" {tlsbinpic.s tlsbin.s}
55 {{readelf -WSsrl tlsbin.rd} {objdump -drj.text tlsbin.dd}
56 {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}}
57 "tlsbin"}
58 {"TLS -fpic and -fno-pic exec transitions without PLT"
59 "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info \
60 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv" ""
61 "-mrelax-relocations=yes --64" {tlsbinpic2.s tlsbin.s}
62 {{readelf -WSsrl tlsbin2.rd} {objdump -drj.text tlsbin2.dd}
63 {objdump -sj.got tlsbin2.sd} {objdump -sj.tdata tlsbin2.td}}
64 "tlsbin2"}
65 {"TLS descriptor -fpic and -fno-pic exec transitions"
66 "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info \
67 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv" ""
68 "--64" {tlsbindesc.s tlsbin.s}
69 {{readelf -WSsrl tlsbindesc.rd} {objdump -drj.text tlsbindesc.dd}
70 {objdump -sj.got tlsbindesc.sd} {objdump -sj.tdata tlsbindesc.td}}
71 "tlsbindesc"}
72 {"TLS with global dynamic and descriptors"
73 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
74 -z nomark-plt \
75 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv" ""
76 "--64" {tlsgdesc.s}
77 {{readelf -WSsrl tlsgdesc.rd} {objdump -drj.text\ -Mintel64 tlsgdesc.dd}}
78 "libtlsgdesc.so"}
79 {"TLS in debug sections" "-melf_x86_64" ""
80 "--64" {tlsg.s}
81 {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
82 {"TLS GD->LE transition" "-melf_x86_64" ""
83 "--64" {tlsgd1.s}
84 {{objdump -dwr tlsgd1.dd}} "tlsgd1"}
85 {"TLS LD->LE transition" "-melf_x86_64" ""
86 "--64" {tlsld1.s}
87 {{objdump -dwr tlsld1.dd}} "tlsld1"}
88 {"TLS IE->LE transition" "-melf_x86_64" ""
89 "--64" {tlsie1.s}
90 {{objdump -dwr tlsie1.dd}} "tlsie1"}
91 {"Helper 64bit object 1" "-r -melf_x86_64" ""
92 "--64" {mixed1a.s} {} "libmixe1a.o"}
93 {"Helper 32bit object 1" "-r -melf_i386" ""
94 "--32" {mixed1b.s} {} "libmixe1b.o"}
95 {"Helper 64bit object 2" "-r -melf_x86_64" ""
96 "--64" {mixed2a.s} {} "libmixe2a.o"}
97 {"Helper 32bit object 2" "-r -melf_i386" ""
98 "--32" {mixed2b.s} {} "libmixe2b.o"}
99 {"Split by file with 'l' flag on section."
100 "-split-by-file -r -melf_x86_64" ""
101 "--64" {split-by-file1.s split-by-file2.s}
102 {{readelf -SW split-by-file.rd}} "split-by-file.o"}
103 {"TLS X32 IE->LE transition" "-melf32_x86_64" ""
104 "--x32" {tlsie4.s}
105 {{objdump -dwr tlsie4.dd}} "tlsie4"}
106 {"TLS X32 GD->LE transition" "-melf32_x86_64" ""
107 "--x32" {tlsgd4.s}
108 {{objdump -dwr tlsgd4.dd}} "tlsgd4"}
109 {"Helper TLS GD->IE transition DSO" "-shared -melf_x86_64" ""
110 "--64" {tlsgd5b.s} {} "libtlsgd5.so"}
111 {"TLS GD->IE transition" "-melf_x86_64 tmpdir/libtlsgd5.so" ""
112 "--64" {tlsgd5a.s}
113 {{objdump -dwr tlsgd5.dd}} "tlsgd5a"}
114 {"TLS GD->IE transition without PLT"
115 "-melf_x86_64 tmpdir/libtlsgd5.so" ""
116 "-mrelax-relocations=yes --64" {tlsgd5c.s}
117 {{objdump -dwr tlsgd5.dd}} "tlsgd5b"}
118 {"Helper TLS X32 GD->IE transition DSO" "-shared -melf32_x86_64" ""
119 "--x32" {tlsgd6b.s} {} "libtlsgd6.so"}
120 {"TLS X32 GD->IE transition" "-melf32_x86_64 tmpdir/libtlsgd6.so" ""
121 "--x32" {tlsgd6a.s}
122 {{objdump -dwr tlsgd6.dd}} "tlsgd6a"}
123 {"TLS X32 GD->IE transition without PLT"
124 "-melf32_x86_64 tmpdir/libtlsgd6.so" ""
125 "-mrelax-relocations=yes --x32" {tlsgd6c.s}
126 {{objdump -dwr tlsgd6.dd}} "tlsgd6b"}
127 {"TLS X32 LD->LE transition" "-melf32_x86_64" ""
128 "--x32" {tlsld2.s}
129 {{objdump -dwr tlsld2.dd}} "tlsld2"}
130 {"TLS -mcmodel=large GD->LE transition" "-melf_x86_64" ""
131 "--64" {tlsgd7.s}
132 {{objdump -dwr tlsgd7.dd}} "tlsgd7"}
133 {"TLS -mcmodel=large LD->LE transition" "-melf_x86_64" ""
134 "--64" {tlsld3.s}
135 {{objdump -dwr tlsld3.dd}} "tlsld3"}
136 {"TLS -mcmodel=large LD->LE transition with r15 as GOT base"
137 "-melf_x86_64" ""
138 "--64" {tlsld4.s}
139 {{objdump -dwr tlsld4.dd}} "tlsld4"}
140 {"TLS LD->LE transition without PLT"
141 "-melf_x86_64" ""
142 "--64 -mrelax-relocations=yes"
143 {tlsld5.s}
144 {{objdump -dwr tlsld5.dd}} "tlsld5"}
145 {"TLS X32 LD->LE transition without PLT" "-melf32_x86_64" ""
146 "--x32 -mrelax-relocations=yes"
147 {tlsld6.s}
148 {{objdump -dwr tlsld6.dd}} "tlsld6"}
149 {"TLS -mcmodel=large GD->IE transition" "-melf_x86_64 tmpdir/libtlsgd5.so" ""
150 "--64" {tlsgd8.s}
151 {{objdump -dwrj.text tlsgd8.dd}} "tlsgd8"}
152 {"TLS -mcmodel=large GD->LE transition with r15 as GOT base"
153 "-melf_x86_64" ""
154 "--64" {tlsgd9.s}
155 {{objdump -dwr tlsgd9.dd}} "tlsgd9"}
156 {"TLS -mcmodel=large GD->IE transition with r15 as GOT base"
157 "-melf_x86_64 tmpdir/libtlsgd5.so" ""
158 "--64" {tlsgd10.s}
159 {{objdump -dwrj.text tlsgd10.dd}} "tlsgd10"}
160 {"TLS GD->LE transition without PLT"
161 "-melf_x86_64" ""
162 "--64" {tlsgd11.s}
163 {{objdump -dwr tlsgd11.dd}} "tlsgd11"}
164 {"TLS X32 GD->LE transition without PLT"
165 "-melf32_x86_64" ""
166 "--x32" {tlsgd14.s}
167 {{objdump -dwr tlsgd14.dd}} "tlsgd14"}
168 {"build 32-bit object with 33 locals" "-melf_x86_64 -e 0" "" "--32" {32bit.s} {{ ld incompatible.l }} "dummy" }
169 {"build 64-bit object" "-melf_x86_64 -e 0 --defsym foo=1" "" "--64" {64bit.s} {} "dummy" }
170 {"link mixed objects" "-melf_x86_64 -e 0 tmpdir/32bit.o tmpdir/64bit.o" "" "" {} { { ld incompatible.l } } "mixed"}
171 {"PR ld/17313 (1)" "-melf_x86_64" ""
172 "--64" {dummy.s} {} ""}
173 {"PR ld/17313 (2)" "-melf_x86_64 -shared --just-symbols=tmpdir/dummy.o" ""
174 "--64" {lea1.s} {} "libpr17313.so"}
175 {"PR ld/17306 (1)" "-melf_x86_64" ""
176 "--64" {pr17306b.s} {} ""}
177 {"PR ld/17306 (2)" "-melf_x86_64 -shared -Bsymbolic --just-symbols=tmpdir/pr17306b.o" ""
178 "--64" {pr17306a.s} {} "libpr17306.so"}
179 {"PR ld/17709 (1)" "-melf_x86_64 -shared" ""
180 "--64" {pr17709a.s} {} "libpr17709.so"}
181 {"PR ld/17709 (2)" "-melf_x86_64 tmpdir/libpr17709.so" ""
182 "--64" {pr17709b.s} {{ld "pr17709.err"}} "pr17709"}
183 {"Build pr19827a.o" "" ""
184 "--64" { pr19827a.S }}
185 {"Build pr19827b.so" "-melf_x86_64 -shared" ""
186 "--64" { pr19827b.S } {} "pr19827b.so"}
187 {"Build pr19827"
188 "-melf_x86_64 -pie -z notext tmpdir/pr19827a.o tmpdir/pr19827b.so"
189 ""
190 "--64" { dummy.s } {{readelf {-rW} pr19827.rd}} "pr19827"}
191 {"Build pr19827.so"
192 "-melf_x86_64 -shared -Bsymbolic -z notext" ""
193 "--64" { pr19827a.S } {{readelf {-rW} pr19827.rd}} "pr19827.so"}
194 {"Build pr19969.so" "-melf_x86_64 -shared" ""
195 "--64" { pr19969a.S } {} "pr19969.so"}
196 {"Build pr20550a.o" "" ""
197 "--64" { pr20550a.s }}
198 {"Build pr20550b.so" "-melf_x86_64 -shared" ""
199 "--64" { pr20550b.s } {} "pr20550b.so"}
200 {"Build pr20550"
201 "-melf_x86_64 -pie -z notext tmpdir/pr20550a.o tmpdir/pr20550b.so"
202 ""
203 "--64" { dummy.s } {} "pr20550"}
204 {"Build pr27587"
205 "-melf_x86_64 -e main"
206 "" ""
207 { pr27587a.obj.bz2 pr27587b.obj.bz2 }
208 {{ld "pr27587.err"}} "pr27587"}
209 {"Build pr27590.o"
210 "-r -melf_x86_64"
211 "" ""
212 { pr27590a.obj.bz2 pr27590b.obj.bz2 }
213 {{readelf -SW pr27590.rd}} "pr27590.o"}
214 {"Build textrel-1.so" "-melf_x86_64 -shared" ""
215 "--64" { textrel-1a.s } {} "textrel-1.so"}
216 {"Build textrel-1" "-no-pie -melf_x86_64 -z nocopyreloc --warn-textrel"
217 "tmpdir/textrel-1.so"
218 "--64" { textrel-1b.s } {{ld "textrel-1.err"}} "textrel-1"}
219 }
220
221 run_ld_link_tests $x86_64tests
222
223 run_ld_link_tests [list \
224 [list \
225 "TLS -fpic -shared transitions" \
226 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
227 -z nomark-plt \
228 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv \
229 $NO_DT_RELR_LDFLAGS" \
230 "" "--64" \
231 {tlspic1.s tlspic2.s} \
232 {{readelf -WSsrl tlspic.rd} \
233 {objdump {-drj.text -Mintel64} tlspic.dd} \
234 {objdump -sj.got tlspic.sd} \
235 {objdump -sj.tdata tlspic.td}} \
236 "libtlspic.so" \
237 ] \
238 [list \
239 "TLS -fpic -shared transitions with r15 as GOT base" \
240 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
241 -z nomark-plt \
242 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv \
243 $NO_DT_RELR_LDFLAGS" \
244 "" "--64 -mrelax-relocations=yes" \
245 {tlspic3.s tlspic2.s} \
246 {{readelf -WSsrl tlspic2.rd} \
247 {objdump {-drj.text -Mintel64} tlspic2.dd} \
248 {objdump -sj.got tlspic2.sd} \
249 {objdump -sj.tdata tlspic2.td}} \
250 "libtlspic2.so" \
251 ] \
252 [list \
253 "TLS descriptor -fpic -shared transitions" \
254 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
255 -z nomark-plt \
256 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv \
257 $NO_DT_RELR_LDFLAGS" \
258 "" "--64" \
259 {tlsdesc.s tlspic2.s} \
260 {{readelf -WSsrld tlsdesc.rd} \
261 {objdump -drj.text tlsdesc.dd} \
262 {objdump {-s -j.got -j.got.plt} tlsdesc.sd} \
263 {objdump -sj.tdata tlsdesc.td} \
264 {objdump -drj.plt tlsdesc.pd}} \
265 "libtlsdesc.so" \
266 ] \
267 ]
268
269 set test_name "Mixed x86_64 and i386 input test 1"
270 set test mixed1
271 if { ![ld_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
272 if [string match "*i386* architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
273 pass "$test_name"
274 } {
275 fail "$test_name"
276 }
277 }
278
279 set test_name "Mixed x86_64 and i386 input test 2"
280 set test mixed2
281 if { ![ld_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
282 if [string match "*i386* architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
283 pass "$test_name"
284 } {
285 fail "$test_name"
286 }
287 }
288
289 run_dump_test "abs"
290 run_dump_test "apic"
291 run_dump_test "pcrel8"
292 run_dump_test "pcrel16"
293 run_dump_test "pcrel16-2"
294 run_dump_test "rela"
295 run_dump_test "tlsgd2"
296 run_dump_test "tlsgd3"
297 run_dump_test "tlsgd12"
298 run_dump_test "tlsgd13"
299 run_dump_test "tlsie2"
300 run_dump_test "tlsie3"
301 run_dump_test "hidden1"
302 run_dump_test "hidden2"
303 run_dump_test "hidden3"
304 run_dump_test "hidden4"
305 run_dump_test "hidden5"
306 run_dump_test "protected1"
307 run_dump_test "protected2"
308 run_dump_test "protected3"
309 run_dump_test "protected4"
310 run_dump_test "protected5"
311 run_dump_test "protected6a"
312 run_dump_test "protected6b"
313 run_dump_test "protected7a"
314 run_dump_test "protected7b"
315 run_dump_test "protected8"
316 run_dump_test "tlsle1"
317 run_dump_test "tlspie1"
318 run_dump_test "tlspie2a"
319 run_dump_test "tlspie2b"
320 run_dump_test "tlspie2c"
321 run_dump_test "unique1"
322 run_dump_test "nogot1"
323 run_dump_test "nogot2"
324 run_dump_test "discarded1"
325 run_dump_test "pr12718"
326 run_dump_test "pr12921"
327 run_dump_test "pr13947"
328 run_dump_test "pr12570a"
329 run_dump_test "pr12570b"
330 run_dump_test "pr14215"
331 run_dump_test "pr14207"
332 run_dump_test "gotplt1"
333 run_dump_test "pie1"
334 run_dump_test "pie2"
335 run_dump_test "pie3"
336 run_dump_test "pic1"
337 run_dump_test "largecomm-1a"
338 run_dump_test "largecomm-1b"
339 run_dump_test "largecomm-1c"
340 run_dump_test "largecomm-1d"
341 run_dump_test "largecomm-1e"
342 run_dump_test "largecomm-1f"
343 run_dump_test "pr19539a"
344 run_dump_test "pr19539b"
345 run_dump_test "pr19807-1a"
346 run_dump_test "pr19807-1b"
347 run_dump_test "pr19807-2a"
348 run_dump_test "pr19807-2b"
349 run_dump_test "pr19807-2c"
350 run_dump_test "pr19807-2d"
351 run_dump_test "pr19807-2e"
352 run_dump_test "pr19969"
353 run_dump_test "pr20093-1"
354 run_dump_test "pr20093-2"
355 run_dump_test "property-x86-3"
356 run_dump_test "property-x86-4a"
357 run_dump_test "property-x86-4b"
358 run_dump_test "property-x86-3-x32"
359 run_dump_test "property-x86-4a-x32"
360 run_dump_test "property-x86-4b-x32"
361 run_dump_test "property-x86-5"
362 run_dump_test "property-x86-5-x32"
363 run_dump_test "property-x86-6"
364 run_dump_test "property-x86-6-x32"
365 run_dump_test "property-x86-ibt1a"
366 run_dump_test "property-x86-ibt1b"
367 run_dump_test "property-x86-ibt1a-x32"
368 run_dump_test "property-x86-ibt1b-x32"
369 run_dump_test "property-x86-ibt2"
370 run_dump_test "property-x86-ibt2-x32"
371 run_dump_test "property-x86-ibt3a"
372 run_dump_test "property-x86-ibt3b"
373 run_dump_test "property-x86-ibt3a-x32"
374 run_dump_test "property-x86-ibt3b-x32"
375 run_dump_test "property-x86-ibt4"
376 run_dump_test "property-x86-ibt4-x32"
377 run_dump_test "property-x86-ibt5"
378 run_dump_test "property-x86-ibt5-x32"
379 run_dump_test "property-x86-shstk1a"
380 run_dump_test "property-x86-shstk1b"
381 run_dump_test "property-x86-shstk1a-x32"
382 run_dump_test "property-x86-shstk1b-x32"
383 run_dump_test "property-x86-shstk2"
384 run_dump_test "property-x86-shstk2-x32"
385 run_dump_test "property-x86-shstk3a"
386 run_dump_test "property-x86-shstk3b"
387 run_dump_test "property-x86-shstk3a-x32"
388 run_dump_test "property-x86-shstk3b-x32"
389 run_dump_test "property-x86-shstk4"
390 run_dump_test "property-x86-shstk4-x32"
391 run_dump_test "property-x86-shstk5"
392 run_dump_test "property-x86-shstk5-x32"
393 run_dump_test "property-x86-cet1"
394 run_dump_test "property-x86-cet1-x32"
395 run_dump_test "property-x86-cet2a"
396 run_dump_test "property-x86-cet2a-x32"
397 run_dump_test "property-x86-cet2b"
398 run_dump_test "property-x86-cet2b-x32"
399 run_dump_test "property-x86-cet3a"
400 run_dump_test "property-x86-cet3a-x32"
401 run_dump_test "property-x86-cet3b"
402 run_dump_test "property-x86-cet3b-x32"
403 run_dump_test "property-x86-cet4a"
404 run_dump_test "property-x86-cet4a-x32"
405 run_dump_test "property-x86-cet4b"
406 run_dump_test "property-x86-cet4b-x32"
407 run_dump_test "property-x86-cet5a"
408 run_dump_test "property-x86-cet5a-x32"
409 run_dump_test "property-x86-cet5b"
410 run_dump_test "property-x86-cet5b-x32"
411 run_dump_test "property-x86-cet6"
412 run_dump_test "property-x86-cet6-x32"
413 run_dump_test "property-x86-lam-u48-1a"
414 run_dump_test "property-x86-lam-u48-1b"
415 run_dump_test "property-x86-lam-u48-2"
416 run_dump_test "property-x86-lam-u48-3a"
417 run_dump_test "property-x86-lam-u48-3b"
418 run_dump_test "property-x86-lam-u48-4"
419 run_dump_test "property-x86-lam-u48-5"
420 run_dump_test "property-x86-lam-u57-1a"
421 run_dump_test "property-x86-lam-u57-1b"
422 run_dump_test "property-x86-lam-u57-2"
423 run_dump_test "property-x86-lam-u57-3a"
424 run_dump_test "property-x86-lam-u57-3b"
425 run_dump_test "property-x86-lam-u57-4"
426 run_dump_test "property-x86-lam-u57-5"
427 run_dump_test "pr21884"
428 run_dump_test "pr22071"
429 run_dump_test "pr22115-1a"
430 run_dump_test "pr22115-1a-x32"
431 run_dump_test "pr22115-1b"
432 run_dump_test "pr22115-1b-x32"
433 run_dump_test "pr22115-1c"
434 run_dump_test "pr22115-1c-x32"
435 run_dump_test "pr22115-1d"
436 run_dump_test "pr22115-1d-x32"
437 run_dump_test "pr22135"
438 run_dump_test "pr22782a"
439 run_dump_test "pr22782b"
440 run_dump_test "pr23189"
441 run_dump_test "pr23194"
442 run_dump_test "pr23324a"
443 run_dump_test "pr23324b"
444 run_dump_test "pr23372a"
445 run_dump_test "pr23372a-x32"
446 run_dump_test "pr23372b"
447 run_dump_test "pr23372b-x32"
448 run_dump_test "pr23372c"
449 run_dump_test "pr23372c-x32"
450 run_dump_test "pr23372d"
451 run_dump_test "pr23372d-x32"
452 run_dump_test "pr23486a"
453 run_dump_test "pr23486a-x32"
454 run_dump_test "pr23486b"
455 run_dump_test "pr23486b-x32"
456 run_dump_test "pr23486c"
457 run_dump_test "pr23486c-x32"
458 run_dump_test "pr23486d"
459 run_dump_test "pr23486d-x32"
460 run_dump_test "pr23854"
461 run_dump_test "pr23930"
462 run_dump_test "pr23930-x32"
463 run_dump_test "pr24151a"
464 run_dump_test "pr24151a-x32"
465 run_dump_test "pr24322a"
466 run_dump_test "pr24322a-x32"
467 run_dump_test "pr24322b"
468 run_dump_test "pr24322b-x32"
469 run_dump_test "pr24458a"
470 run_dump_test "pr24458a-x32"
471 run_dump_test "pr24458b"
472 run_dump_test "pr24458b-x32"
473 run_dump_test "pr24458c"
474 run_dump_test "pr24458c-x32"
475 run_dump_test "pr24721"
476 run_dump_test "pr24721-x32"
477 run_dump_test "pr24905"
478 run_dump_test "pr24905-x32"
479 run_dump_test "align-branch-1"
480 run_dump_test "pr25416-1a"
481 run_dump_test "pr25416-2b"
482 run_dump_test "pr25416-2a"
483 run_dump_test "pr25416-2b"
484 run_dump_test "pr25416-3"
485 run_dump_test "pr25416-4"
486 run_dump_test "pr26018"
487 run_dump_test "pr26263"
488 run_dump_test "pr26711-1"
489 run_dump_test "pr26711-1-x32"
490 run_dump_test "pr26711-2"
491 run_dump_test "pr26711-2-x32"
492 run_dump_test "pr26711-3"
493 run_dump_test "pr26711-3-x32"
494 run_dump_test "property-x86-isa1"
495 run_dump_test "property-x86-isa1-x32"
496 run_dump_test "property-x86-isa2"
497 run_dump_test "property-x86-isa2-x32"
498 run_dump_test "property-x86-isa3"
499 run_dump_test "property-x86-isa3-x32"
500 run_dump_test "property-x86-isa4"
501 run_dump_test "property-x86-isa4-x32"
502 run_dump_test "code16"
503 run_dump_test "pr27491-1a"
504 run_dump_test "pr27491-1b"
505 run_dump_test "pr27491-1c"
506 run_dump_test "pr27491-2"
507 run_dump_test "pr27491-3"
508 run_dump_test "pr27491-4"
509 run_dump_test "dt-relr-1a"
510 run_dump_test "dt-relr-1a-x32"
511 run_dump_test "dt-relr-1b"
512 run_dump_test "dt-relr-1b-x32"
513 run_dump_test "pr30787"
514
515 if { ![skip_sframe_tests] } {
516 run_dump_test "sframe-simple-1"
517 run_dump_test "sframe-plt-1"
518 }
519
520 if ![istarget "x86_64-*-linux*"] {
521 return
522 }
523
524 if ![ld_assemble $as "--x32 $srcdir/$subdir/start.s" tmpdir/startx32.o] {
525 fail "Build ILP32 start.o"
526 return
527 }
528
529 if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] {
530 fail "Build ia32 start.o"
531 return
532 }
533
534 if ![ld_assemble $as "--64 $srcdir/$subdir/start.s" tmpdir/start64.o] {
535 fail "Build LP64 start.o"
536 return
537 }
538
539 if ![ld_assemble $as "--x32 $srcdir/$subdir/foo.s" tmpdir/foox32.o] {
540 fail "Build ILP32 foo.o"
541 return
542 }
543
544 if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] {
545 fail "Build ia32 foo.o"
546 return
547 }
548
549 if ![ld_assemble $as "--64 $srcdir/$subdir/foo.s" tmpdir/foo64.o] {
550 fail "Build LP64 foo.o"
551 return
552 }
553
554 run_dump_test "compressed1"
555 run_dump_test "ilp32-1"
556 run_dump_test "ilp32-2"
557 run_dump_test "ilp32-3"
558 run_dump_test "ilp32-4"
559 run_dump_test "ilp32-5"
560 run_dump_test "ilp32-6"
561 run_dump_test "ilp32-7"
562 run_dump_test "ilp32-8"
563 run_dump_test "ilp32-9"
564 run_dump_test "ilp32-10"
565 run_dump_test "ilp32-11"
566 run_dump_test "ilp32-12"
567 run_dump_test "ia32-1"
568 run_dump_test "ia32-2"
569 run_dump_test "ia32-3"
570 run_dump_test "lp64-1"
571 run_dump_test "lp64-2"
572 run_dump_test "lp64-3"
573 run_dump_test "pr13082-1a"
574 run_dump_test "pr13082-1b"
575 run_dump_test "pr13082-2a"
576 run_dump_test "pr13082-2b"
577 run_dump_test "pr13082-3a"
578 run_dump_test "pr13082-3b"
579 run_dump_test "pr13082-3c"
580 run_dump_test "pr13082-3d"
581 run_dump_test "pr13082-4a"
582 run_dump_test "pr13082-4b"
583 run_dump_test "pr13082-5a"
584 run_dump_test "pr13082-5b"
585 run_dump_test "pr13082-6a"
586 run_dump_test "pr13082-6b"
587 run_dump_test "lea1a"
588 run_dump_test "lea1b"
589 run_dump_test "lea1c"
590 run_dump_test "lea1d"
591 run_dump_test "lea1e"
592 run_dump_test "lea1f"
593 run_dump_test "lea1g"
594 run_dump_test "lea1h"
595 run_dump_test "lea1i"
596 run_dump_test "lea1j"
597 run_dump_test "lea1k"
598 run_dump_test "lea1l"
599 run_dump_test "mov1a"
600 run_dump_test "mov1b"
601 run_dump_test "mov1c"
602 run_dump_test "mov1d"
603 run_dump_test "mov2a"
604 run_dump_test "mov2b"
605 run_dump_test "mov2c"
606 run_dump_test "mov2d"
607 run_dump_test "ljmp1"
608 run_dump_test "ljmp2"
609 run_dump_test "load1a"
610 run_dump_test "load1b"
611 run_dump_test "load1c"
612 run_dump_test "load1d"
613 run_dump_test "apx-load1a"
614 run_dump_test "apx-load1b"
615 run_dump_test "apx-load1c"
616 run_dump_test "apx-load1d"
617 run_dump_test "load2"
618 run_dump_test "call1a"
619 run_dump_test "call1b"
620 run_dump_test "call1c"
621 run_dump_test "call1d"
622 run_dump_test "call1e"
623 run_dump_test "call1f"
624 run_dump_test "call1g"
625 run_dump_test "call1h"
626 run_dump_test "call1i"
627 run_dump_test "pr17935-1"
628 run_dump_test "pr17935-2"
629 run_dump_test "pr18160"
630 run_dump_test "pr18176"
631 run_dump_test "pr18801a"
632 run_dump_test "pr18801b"
633 run_dump_test "ifunc-textrel-1a"
634 run_dump_test "ifunc-textrel-1b"
635 run_dump_test "ifunc-textrel-2a"
636 run_dump_test "ifunc-textrel-2b"
637 run_dump_test "pr18815"
638 run_dump_test "pr19013"
639 run_dump_test "pr19013-x32"
640 run_dump_test "pr19162"
641 run_dump_test "pr19175"
642 run_dump_test "pr18591"
643 run_dump_test "pr19615"
644 run_dump_test "pr19636-1a"
645 run_dump_test "pr19636-1b"
646 run_dump_test "pr19636-1c"
647 run_dump_test "pr19636-1d"
648 run_dump_test "pr19636-1e"
649 run_dump_test "pr19636-1f"
650 run_dump_test "pr19636-1g"
651 run_dump_test "pr19636-1h"
652 run_dump_test "pr19636-1i"
653 run_dump_test "pr19636-1j"
654 run_dump_test "pr19636-2a"
655 run_dump_test "pr19636-2b"
656 run_dump_test "pr19636-2c"
657 run_dump_test "pr19636-2d"
658 run_dump_test "pr19636-2e"
659 run_dump_test "pr19636-2f"
660 run_dump_test "pr19636-2g"
661 run_dump_test "pr19636-2h"
662 run_dump_test "pr19636-2i"
663 run_dump_test "pr19636-2j"
664 run_dump_test "pr19636-2k"
665 run_dump_test "pr19636-2l"
666 run_dump_test "pr19636-2m"
667 run_dump_test "pr19636-3a"
668 run_dump_test "pr19636-3b"
669 run_dump_test "pr19636-3c"
670 run_dump_test "pr19645"
671 run_dump_test "pr19609-1a"
672 run_dump_test "pr19609-1b"
673 run_dump_test "pr19609-1c"
674 run_dump_test "pr19609-1d"
675 run_dump_test "pr19609-1e"
676 run_dump_test "pr19609-1f"
677 run_dump_test "pr19609-1g"
678 run_dump_test "pr19609-1h"
679 run_dump_test "pr19609-1i"
680 run_dump_test "pr19609-1j"
681 run_dump_test "pr19609-1k"
682 run_dump_test "pr19609-1l"
683 run_dump_test "pr19609-1m"
684 run_dump_test "pr19609-2a"
685 run_dump_test "pr19609-2b"
686 run_dump_test "pr19609-2c"
687 run_dump_test "pr19609-2d"
688 run_dump_test "pr19609-3a"
689 run_dump_test "pr19609-3b"
690 run_dump_test "pr19609-4a"
691 run_dump_test "pr19609-4b"
692 run_dump_test "pr19609-4c"
693 run_dump_test "pr19609-4d"
694 run_dump_test "pr19609-4e"
695 run_dump_test "pr19609-5a"
696 run_dump_test "pr19609-5b"
697 run_dump_test "pr19609-5c"
698 run_dump_test "pr19609-5d"
699 run_dump_test "pr19609-5e"
700 run_dump_test "pr19609-6a"
701 run_dump_test "pr19609-6b"
702 run_dump_test "pr19609-6c"
703 run_dump_test "pr19609-6d"
704 run_dump_test "pr19609-7a"
705 run_dump_test "pr19609-7b"
706 run_dump_test "pr19609-7c"
707 run_dump_test "pr19609-7d"
708 run_dump_test "pr19939a"
709 run_dump_test "pr19939b"
710 run_dump_test "pr19719"
711 run_dump_test "pr20253-1a"
712 run_dump_test "pr20253-1b"
713 run_dump_test "pr20253-1c"
714 run_dump_test "pr20253-1d"
715 run_dump_test "pr20253-1e"
716 run_dump_test "pr20253-1f"
717 run_dump_test "pr20253-1g"
718 run_dump_test "pr20253-1h"
719 run_dump_test "pr20253-1i"
720 run_dump_test "pr20253-1j"
721 run_dump_test "pr20253-1k"
722 run_dump_test "pr20253-1l"
723 run_dump_test "pr20253-3"
724 run_dump_test "pr20253-4a"
725 run_dump_test "pr20253-4b"
726 run_dump_test "pr20253-4c"
727 run_dump_test "pr20253-4d"
728 run_dump_test "pr20253-4e"
729 run_dump_test "pr20253-4f"
730 run_dump_test "pr20253-5a"
731 run_dump_test "pr20253-5b"
732 run_dump_test "tlsdesc2"
733 run_dump_test "pr22048"
734 run_dump_test "pr22929"
735 run_dump_test "pr26939"
736 run_dump_test "pr26939-x32"
737 run_dump_test "pr27016a"
738 run_dump_test "pr27016b"
739 run_dump_test "report-reloc-1"
740 run_dump_test "report-reloc-1-x32"
741 run_dump_test "pr29820"
742
743 proc undefined_weak {cflags ldflags} {
744 set testname "Undefined weak symbol"
745 if { ![ string match "" $cflags$ldflags] } {
746 set testname "$testname ($cflags $ldflags)"
747 }
748
749 if { [string match "*-fPIE*" $cflags]
750 && ![string match "*nodynamic-undefined-weak*" $ldflags] } {
751 set weak_symbol "Weak defined"
752 } else {
753 set weak_symbol "Weak undefined"
754 }
755
756 run_cc_link_tests [list \
757 [list \
758 "Build libpr19704a.so" \
759 "-shared -Wl,-soname,libpr19704.so" \
760 "" \
761 { dummy.s } \
762 {} \
763 "libpr19704a.so" \
764 ] \
765 [list \
766 "Build libpr19704b.so" \
767 "-shared -Wl,-soname,libpr19704.so" \
768 "-fPIC" \
769 { pr19704b.c } \
770 {} \
771 "libpr19704b.so" \
772 ] \
773 ]
774
775 exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so
776
777 run_ld_link_exec_tests [list \
778 [list \
779 "Run pr19704" \
780 "-Wl,--no-as-needed,-R,tmpdir $ldflags tmpdir/libpr19704.so" \
781 "" \
782 { pr19704a.c } \
783 "pr19704" \
784 "pr19704.out" \
785 "$cflags" \
786 ] \
787 ]
788
789 exec cp tmpdir/libpr19704b.so tmpdir/libpr19704.so
790
791 set exec_output [run_host_cmd tmpdir/pr19704 ""]
792 if {![string match $weak_symbol $exec_output]} {
793 fail $testname
794 } else {
795 pass $testname
796 }
797 }
798
799 # Must be native with the C compiler
800 if { [isnative] && [check_compiler_available] } {
801 run_cc_link_tests [list \
802 [list \
803 "Helper X32 DSO from x86-64 object" "" \
804 "-m64 $NOSANITIZE_CFLAGS -fPIC -g" \
805 {simple.c} {} "libsimple.a" \
806 ] \
807 ]
808
809 set convertx32 "$objcopy -O elf32-x86-64 tmpdir/simple.o tmpdir/simple-x32.o"
810 send_log "$convertx32\n"
811 set got [remote_exec host "$convertx32"]
812 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
813 send_log "$got\n"
814 fail "Convert x86-64 object to x32"
815 return
816 }
817
818 run_ld_link_tests [list \
819 [list \
820 "X32 DSO from x86-64 object" \
821 "-shared -melf32_x86_64 tmpdir/simple-x32.o" \
822 "$NOSANITIZE_CFLAGS" \
823 "--x32 -mx86-used-note=yes" \
824 {dummy.s} {{readelf {-s --wide} x86-64-x32.rd}} \
825 "x86-64-x32" \
826 ] \
827 ]
828
829 run_cc_link_tests [list \
830 [list \
831 "Build plt-lib.so" \
832 "-shared" \
833 "-fPIC -Wa,-mx86-used-note=yes" \
834 { plt-lib.c } \
835 {} \
836 "libplt-lib.so" \
837 ] \
838 [list \
839 "Build libplt-main1.a" \
840 "" \
841 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
842 { plt-main1.c } \
843 {{readelf {-Wr} plt-main1.rd}} \
844 "libplt-main1.a" \
845 ] \
846 [list \
847 "Build libplt-main2.a" \
848 "" \
849 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
850 { plt-main2.c } \
851 {{readelf {-Wr} plt-main2.rd}} \
852 "libplt-main2.a" \
853 ] \
854 [list \
855 "Build libplt-main3.a" \
856 "" \
857 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes $PLT_CFLAGS" \
858 { plt-main3.c } \
859 {{readelf {-Wr} plt-main3.rd}} \
860 "libplt-main3.a" \
861 ] \
862 [list \
863 "Build libplt-main4.a" \
864 "" \
865 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes $PLT_CFLAGS" \
866 { plt-main4.c } \
867 {{readelf {-Wr} plt-main4.rd}} \
868 "libplt-main4.a" \
869 ] \
870 [list \
871 "Build plt-main" \
872 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
873 tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
874 "" \
875 { plt-main5.c } \
876 {{readelf {-Wr} plt-main.rd}} \
877 "plt-main" \
878 ] \
879 [list \
880 "Build plt-main with PIE" \
881 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
882 tmpdir/plt-main4.o tmpdir/libplt-lib.so -pie" \
883 "-fPIC -Wa,-mx86-used-note=yes" \
884 { plt-main5.c } \
885 {{readelf {-Wr} plt-main.rd}} \
886 "plt-main" \
887 ] \
888 [list \
889 "Build copyreloc-lib.so" \
890 "-shared" \
891 "-fPIC -Wa,-mx86-used-note=yes" \
892 { copyreloc-lib.c } \
893 {} \
894 "copyreloc-lib.so" \
895 ] \
896 [list \
897 "Build libcopyreloc-main.a" \
898 "" \
899 "-Wa,-mx86-used-note=yes" \
900 { copyreloc-main.S } \
901 {} \
902 "libcopyreloc-main.a" \
903 ] \
904 [list \
905 "Build copyreloc-main with PIE without -fPIE (1)" \
906 "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
907 "-Wa,-mx86-used-note=yes" \
908 { dummy.s } \
909 {{readelf {-Wr} copyreloc-main1.rd}} \
910 "copyreloc-main" \
911 ] \
912 [list \
913 "Build copyreloc-main with PIE without -fPIE (2)" \
914 "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
915 "-Wa,-mx86-used-note=yes" \
916 { dummy.s } \
917 {{readelf {-Wr} copyreloc-main2.rd}} \
918 "copyreloc-main" \
919 ] \
920 [list \
921 "Build pr17689.so" \
922 "-shared" \
923 "-fPIC -Wa,-mx86-used-note=yes" \
924 { pr17689a.c } \
925 {} \
926 "pr17689.so" \
927 ] \
928 [list \
929 "Build pr17689now.so with -z now" \
930 "-shared -Wl,-z,now" \
931 "-fPIC -Wa,-mx86-used-note=yes" \
932 { pr17689a.c } \
933 {{readelf {-Wr} pr17689now.rd}} \
934 "pr17689now.so" \
935 ] \
936 [list \
937 "Build pr17689b.o" \
938 "" \
939 "-Wa,-mx86-used-note=yes" \
940 { pr17689b.S } \
941 {} \
942 ] \
943 [list \
944 "Build pr17689 with PIE without -fPIE" \
945 "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
946 "-Wa,-mx86-used-note=yes" \
947 { dummy.s } \
948 {{readelf {-Wr} pr17689.rd}} \
949 "pr17689" \
950 ] \
951 [list \
952 "Build pr17689 with PIE -z now without -fPIE" \
953 "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \
954 "-Wa,-mx86-used-note=yes" \
955 { dummy.s } \
956 {{readelf {-Wr} pr17689now.rd}} \
957 "pr17689now" \
958 ] \
959 [list \
960 "Build pr17827 with PIE without -fPIE" \
961 "-Wl,--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
962 "-Wa,-mx86-used-note=yes" \
963 { dummy.s } \
964 {{readelf {-Wr} pr17827.rd}} \
965 "pr17827" \
966 ] \
967 [list \
968 "Build pr18900.so" \
969 "-shared" \
970 "-fPIC -Wa,-mx86-used-note=yes" \
971 { pr18900a.c } \
972 "" \
973 "pr18900.so" \
974 ] \
975 [list \
976 "Build pr18900.o" \
977 "-r -nostdlib" \
978 "-Wa,-mx86-used-note=yes" \
979 { pr18900b.c pr18900c.c } \
980 "" \
981 "pr18900.o" \
982 ] \
983 [list \
984 "Build pr18900a" \
985 "tmpdir/pr18900.o tmpdir/pr18900.so" \
986 "-Wa,-mx86-used-note=yes" \
987 { dummy.s } \
988 {{readelf {-Wrd} pr18900a.rd}} \
989 "pr18900a" \
990 ] \
991 [list \
992 "Build pr18900b" \
993 "-Wl,--as-needed tmpdir/pr18900.o tmpdir/pr18900.so" \
994 "-Wa,-mx86-used-note=yes" \
995 { dummy.s } \
996 {{readelf {-Wrd} pr18900b.rd}} \
997 "pr18900b" \
998 ] \
999 [list \
1000 "Build pr19031.so" \
1001 "-shared" \
1002 "-fPIC -Wa,-mx86-used-note=yes" \
1003 { pr19031a.c } \
1004 "" \
1005 "pr19031.so" \
1006 ] \
1007 [list \
1008 "Build gotpcrel1d.so" \
1009 "-shared" \
1010 "-Wa,-mx86-used-note=yes" \
1011 { gotpcrel1d.S } \
1012 "" \
1013 "gotpcrel1d.so" \
1014 ] \
1015 [list \
1016 "Build gotpcrel1a.o gotpcrel1b.o gotpcrel1c.o" \
1017 "" \
1018 "-Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
1019 { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c } \
1020 ] \
1021 [list \
1022 "Build gotpcrel1" \
1023 "$NOPIE_LDFLAGS -Wl,--as-needed tmpdir/gotpcrel1a.o \
1024 tmpdir/gotpcrel1b.o tmpdir/gotpcrel1c.o \
1025 tmpdir/gotpcrel1d.so" \
1026 "-Wa,-mx86-used-note=yes" \
1027 { dummy.s } \
1028 {{objdump {-dw} gotpcrel1.dd}} \
1029 "gotpcrel1" \
1030 ] \
1031 [list \
1032 "Build pr19319.so" \
1033 "-shared" \
1034 "-Wa,-mx86-used-note=yes" \
1035 { pr19319a.S } \
1036 "" \
1037 "pr19319.so" \
1038 ] \
1039 [list \
1040 "Build pr19319" \
1041 "-pie -nostdlib -nostartfiles tmpdir/pr19319.so" \
1042 "-Wa,-mx86-used-note=yes" \
1043 { pr19319b.S } \
1044 {{objdump {-dw} pr19319.dd}} \
1045 "pr19319" \
1046 ] \
1047 [list \
1048 "Build pr24276.so" \
1049 "-shared -nostdlib -nostartfiles \
1050 -Ltmpdir $srcdir/$subdir/pr24276.dso" \
1051 "-Wa,-mx86-used-note=yes" \
1052 { pr19319b.S } \
1053 {{warning_output pr24276.warn}} \
1054 "pr24276.so" \
1055 ] \
1056 [list \
1057 "Build property 1" \
1058 "" \
1059 "-Wa,-mx86-used-note=no" \
1060 {pass.c property-no-copy.S} \
1061 {{readelf {-n} property-1.r}} \
1062 "property-1" \
1063 ] \
1064 [list \
1065 "Build property 1 (.o)" \
1066 "-r -nostdlib" \
1067 "-Wa,-mx86-used-note=yes" \
1068 {pass.c property-no-copy.S} \
1069 {{readelf {-n} property-1a.r}} \
1070 "property-1.o" \
1071 ] \
1072 [list \
1073 "Build property 1 (.so)" \
1074 "-shared" \
1075 "-fPIC -Wa,-mx86-used-note=no" \
1076 {pass.c property-no-copy.S} \
1077 {{readelf {-n} property-1.r}} \
1078 "property-1.so" \
1079 ] \
1080 [list \
1081 "Build property 2" \
1082 "" \
1083 "-Wa,-mx86-used-note=no" \
1084 {pass.c property-stack.S} \
1085 {{readelf {-n} property-2.r}} \
1086 "property-2" \
1087 ] \
1088 [list \
1089 "Build property 2 (.o)" \
1090 "-r -nostdlib" \
1091 "-Wa,-mx86-used-note=yes" \
1092 {pass.c property-stack.S} \
1093 {{readelf {-n} property-2a.r}} \
1094 "property-2.o" \
1095 ] \
1096 [list \
1097 "Build property 2 (.so)" \
1098 "-shared" \
1099 "-fPIC -Wa,-mx86-used-note=yes" \
1100 {pass.c property-stack.S} \
1101 {{readelf {-n} property-2.r}} \
1102 "property-2.so" \
1103 ] \
1104 [list \
1105 "Build property-6.so" \
1106 "-shared" \
1107 "-fPIC -Wa,-mx86-used-note=yes" \
1108 {property-6a.c property-6c.S} \
1109 {{readelf {-n} property-6.r}} \
1110 "property-6.so" \
1111 ] \
1112 [list \
1113 "Build property-6.o" \
1114 "-r -nostdlib" \
1115 "-Wa,-mx86-used-note=yes" \
1116 {property-6b.c property-stack.S} \
1117 {{readelf {-n} property-2a.r}} \
1118 "property-6.o" \
1119 ] \
1120 [list \
1121 "Build property-6" \
1122 "-Wl,--as-needed tmpdir/property-6.o tmpdir/property-6.so" \
1123 "-Wa,-mx86-used-note=yes" \
1124 { dummy.s } \
1125 {{readelf {-n} property-2.r}} \
1126 "property-6" \
1127 ] \
1128 [list \
1129 "Build property 7a (.o)" \
1130 "-r -nostdlib" \
1131 "-Wa,-mx86-used-note=yes" \
1132 {property-unsorted-1.S} \
1133 {{readelf {-n} property-7a.r}} \
1134 "property-7a.o" \
1135 ] \
1136 [list \
1137 "Build property 7b (.o)" \
1138 "-r -nostdlib" \
1139 "-Wa,-mx86-used-note=yes" \
1140 {property-unsorted-2.S} \
1141 {{readelf {-n} property-7a.r}} \
1142 "property-7b.o" \
1143 ] \
1144 [list \
1145 "Build pr22001-1.so" \
1146 "-shared" \
1147 "-fPIC -Wa,-mx86-used-note=yes" \
1148 { pr22001-1a.c } \
1149 {} \
1150 "pr22001-1.so" \
1151 ] \
1152 [list \
1153 "Build pr22001-1a" \
1154 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1155 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1156 { pr22001-1b.c } \
1157 {{error_output "pr22001-1a.err"}} \
1158 "pr22001-1a" \
1159 ] \
1160 [list \
1161 "Build pr21997-1.so" \
1162 "-shared" \
1163 "-Wa,-mx86-used-note=yes" \
1164 { property-stack.S property-no-copy.S pr21997-1a.S } \
1165 {} \
1166 "pr21997-1.so" \
1167 ] \
1168 [list \
1169 "Build pr21997-1a" \
1170 "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
1171 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1172 { pr21997-1b.c } \
1173 {{error_output "pr21997-1a.err"}} \
1174 "pr21997-1a" \
1175 ] \
1176 [list \
1177 "Build pr22064a.o" \
1178 "" \
1179 "-Wa,-mx86-used-note=yes" \
1180 { pr22064a.S } \
1181 ] \
1182 [list \
1183 "Build pr22064.so" \
1184 "-shared" \
1185 "-fPIC -Wa,-mx86-used-note=yes" \
1186 { pr22064b.c } \
1187 {} \
1188 "pr22064.so" \
1189 ] \
1190 [list \
1191 "Build pr22393-3a.so" \
1192 "-shared -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1193 "-fPIC -Wa,-mx86-used-note=yes" \
1194 {pr22393-3a.c} \
1195 {{readelf -lW pr22393-3a.rd} \
1196 {readelf -lW pr22393-3b.rd}} \
1197 "pr22393-3a.so" \
1198 ] \
1199 [list \
1200 "Build pr22393-3a-now.so" \
1201 "-shared -Wl,-z,separate-code,-z,now,-z,max-page-size=0x1000" \
1202 "-fPIC -Wa,-mx86-used-note=yes" \
1203 {pr22393-3a.c} \
1204 {{readelf -lW pr22393-3a.rd} \
1205 {readelf -lW pr22393-3b.rd}} \
1206 "pr22393-3a-now.so" \
1207 ] \
1208 [list \
1209 "Build pr22393-3" \
1210 "$NOPIE_LDFLAGS -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a.so" \
1211 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1212 {pr22393-3b.c} \
1213 {{readelf -lW pr22393-3a.rd} \
1214 {readelf -lW pr22393-3b.rd}} \
1215 "pr22393-3" \
1216 ] \
1217 [list \
1218 "Build pr22393-3 (PIE)" \
1219 "-pie -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a-now.so" \
1220 "-fPIE -Wa,-mx86-used-note=yes" \
1221 {pr22393-3b.c} \
1222 {{readelf -lW pr22393-3a.rd} \
1223 {readelf -lW pr22393-3b.rd}} \
1224 "pr22393-3-pie" \
1225 ] \
1226 [list \
1227 "Build pr22393-3 (static)" \
1228 "-static -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1229 "-Wa,-mx86-used-note=yes" \
1230 {pr22393-3a.c pr22393-3b.c} \
1231 {{readelf -lW pr22393-3a.rd} \
1232 {readelf -lW pr22393-3b.rd}} \
1233 "pr22393-3-static" \
1234 ] \
1235 [list \
1236 "Build pr22791-1.so" \
1237 "-shared" \
1238 "-fPIC -Wa,-mx86-used-note=yes" \
1239 { pr22791-1a.c } \
1240 {} \
1241 "pr22791-1.so" \
1242 ] \
1243 [list \
1244 "Build pr22791-1" \
1245 "-pie -Wl,--no-as-needed,-z,notext tmpdir/pr22791-1.so" \
1246 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1247 { pr22791-1b.s } \
1248 {{error_output "pr22791-1.err"}} \
1249 "pr22791-1" \
1250 ] \
1251 [list \
1252 "Build pr22791-2a.o" \
1253 "" \
1254 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1255 { pr22791-2a.s } \
1256 ] \
1257 [list \
1258 "Build pr22791-2.so" \
1259 "-shared tmpdir/pr22791-2a.o" \
1260 "-fPIC -Wa,-mx86-used-note=yes" \
1261 { pr22791-2b.c } \
1262 {{readelf -drW pr22791-2.rd}} \
1263 "pr22791-2.so" \
1264 ] \
1265 [list \
1266 "Build pr22791-2" \
1267 "-pie -Wl,--no-as-needed tmpdir/pr22791-2.so" \
1268 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1269 { pr22791-2c.s } \
1270 {{readelf -drW pr22791-2.rd}} \
1271 "pr22791-2" \
1272 ] \
1273 [list \
1274 "Build pr22842.so" \
1275 "-shared" \
1276 "-fPIC -Wa,-mx86-used-note=yes" \
1277 { pr22842a.c } \
1278 {} \
1279 "pr22842.so" \
1280 ] \
1281 [list \
1282 "Build pr22842" \
1283 "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
1284 "-Wa,-mx86-used-note=yes" \
1285 { pr22842b.S } \
1286 {{readelf -rW pr22842a.rd} \
1287 {readelf -rW pr22842b.rd}} \
1288 "pr22842" \
1289 ] \
1290 [list \
1291 "Build libprotected-func-1.so" \
1292 "-shared" \
1293 "-fPIC -Wa,-mx86-used-note=yes" \
1294 { protected-func-1a.s } \
1295 {} \
1296 "libprotected-func-1.so" \
1297 ] \
1298 [list \
1299 "Build libprotected-func-2a.so" \
1300 "-shared" \
1301 "-fPIC -Wa,-mx86-used-note=yes" \
1302 { protected-func-2a.S } \
1303 {{readelf -n indirect-extern-access.rd}} \
1304 "libprotected-func-2a.so" \
1305 ] \
1306 [list \
1307 "Build libprotected-func-2b.so" \
1308 "-shared -z indirect-extern-access" \
1309 "-fPIC -Wa,-mx86-used-note=yes" \
1310 { protected-func-2c.c } \
1311 {{readelf -n indirect-extern-access.rd}} \
1312 "libprotected-func-2b.so" \
1313 ] \
1314 [list \
1315 "Build protected-func-2 without PIE" \
1316 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
1317 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1318 { protected-func-1b.c } \
1319 {{error_output "pr28875-func.err"}} \
1320 "protected-func-2" \
1321 ] \
1322 [list \
1323 "Build libprotected-func-2c.so" \
1324 "-shared" \
1325 "-fPIC -Wa,-mx86-used-note=yes" \
1326 { protected-func-2c.c } \
1327 {} \
1328 "libprotected-func-2c.so" \
1329 ] \
1330 [list \
1331 "Build protected-func-2a without PIE" \
1332 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \
1333 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1334 { protected-func-1b.c } \
1335 {{error_output "pr28875-func.err"}} \
1336 "protected-func-2a" \
1337 ] \
1338 [list \
1339 "Build libprotected-data-1a.so" \
1340 "-shared -z noindirect-extern-access" \
1341 "-fPIC -Wa,-mx86-used-note=yes" \
1342 { protected-data-1a.c } \
1343 {} \
1344 "libprotected-data-1a.so" \
1345 ] \
1346 [list \
1347 "Build libprotected-data-1b.so" \
1348 "-shared -z indirect-extern-access" \
1349 "-fPIC -Wa,-mx86-used-note=yes" \
1350 { protected-data-1a.c } \
1351 {} \
1352 "libprotected-data-1b.so" \
1353 ] \
1354 [list \
1355 "Build protected-data-1 without PIE" \
1356 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-1b.so" \
1357 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1358 { protected-data-1b.c } \
1359 {{error_output "pr28875-data.err"}} \
1360 "protected-data-1" \
1361 ] \
1362 [list \
1363 "Build libprotected-data-2a.so" \
1364 "-shared" \
1365 "-fPIC -Wa,-mx86-used-note=yes \
1366 -DUSE_GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS" \
1367 { protected-data-2a.S } \
1368 {{readelf -n indirect-extern-access.rd}} \
1369 "libprotected-data-2a.so" \
1370 ] \
1371 [list \
1372 "Build libprotected-data-2b.so" \
1373 "-shared -z indirect-extern-access" \
1374 "-fPIC -Wa,-mx86-used-note=yes" \
1375 { protected-data-2a.S } \
1376 {{readelf -n indirect-extern-access.rd}} \
1377 "libprotected-data-2b.so" \
1378 ] \
1379 ]
1380
1381 if {[istarget "x86_64-*-linux*-gnux32"]} {
1382 run_cc_link_tests [list \
1383 [list \
1384 "Build pr25416-5b.o (GDesc -maddress-mode=short)" \
1385 "" \
1386 "-Wa,-mx86-used-note=yes" \
1387 { pr25416-5b.s } \
1388 ] \
1389 [list \
1390 "Build pr25416-5b.so (GDesc -> IE -maddress-mode=short)" \
1391 "-shared" \
1392 "-fPIC -Wa,-mx86-used-note=yes" \
1393 { pr25416-5b.s pr25416-5d.s } \
1394 {} \
1395 "pr25416-5b.so" \
1396 ] \
1397 [list \
1398 "Build pr25416-5c.o (GDesc -maddress-mode=long)" \
1399 "" \
1400 "-Wa,-mx86-used-note=yes" \
1401 { pr25416-5c.s } \
1402 ] \
1403 [list \
1404 "Build pr25416-5c.so (GDesc -> IE -maddress-mode=long)" \
1405 "-shared" \
1406 "-fPIC -Wa,-mx86-used-note=yes" \
1407 { pr25416-5c.s pr25416-5d.s } \
1408 {} \
1409 "pr25416-5c.so" \
1410 ] \
1411 [list \
1412 "Build pr25416-5d.so (GDesc -maddress-mode=short)" \
1413 "-shared" \
1414 "-fPIC -Wa,-mx86-used-note=yes" \
1415 { pr25416-5b.s pr25416-5e.s } \
1416 {} \
1417 "pr25416-5d.so" \
1418 ] \
1419 [list \
1420 "Build pr25416-5d.o (IE -maddress-mode=short)" \
1421 "" \
1422 "-Wa,-mx86-used-note=yes" \
1423 { pr25416-5d.s } \
1424 ] \
1425 [list \
1426 "Build pr21997-1b" \
1427 "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
1428 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1429 { pr21997-1c.c } \
1430 {{error_output "pr21997-1b.err"}} \
1431 "pr21997-1b" \
1432 ] \
1433 ]
1434
1435 run_ld_link_exec_tests [list \
1436 [list \
1437 "Run pr22001-1b" \
1438 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1439 "-Wa,-mx86-used-note=yes" \
1440 { pr22001-1c.c } \
1441 "pr22001-1b" \
1442 "pass.out" \
1443 "$NOPIE_CFLAGS" \
1444 ] \
1445 [list \
1446 "Run pr25416-5a (GDesc -> IE -maddress-mode=short)" \
1447 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5b.so" \
1448 "-Wa,-mx86-used-note=yes" \
1449 { pr25416-5a.c } \
1450 "pr25416-5a" \
1451 "pass.out" \
1452 "$NOPIE_CFLAGS" \
1453 ] \
1454 [list \
1455 "Run pr25416-5b (GDesc -> LE -maddress-mode=short" \
1456 "$NOPIE_LDFLAGS tmpdir/pr25416-5b.o tmpdir/pr25416-5d.o" \
1457 "-Wa,-mx86-used-note=yes" \
1458 { pr25416-5a.c } \
1459 "pr25416-5b" \
1460 "pass.out" \
1461 "$NOPIE_CFLAGS" \
1462 ] \
1463 [list \
1464 "Run pr25416-5c (GDesc -> IE -maddress-mode=long)" \
1465 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5c.so" \
1466 "-Wa,-mx86-used-note=yes" \
1467 { pr25416-5a.c } \
1468 "pr25416-5c" \
1469 "pass.out" \
1470 "$NOPIE_CFLAGS" \
1471 ] \
1472 [list \
1473 "Run pr25416-5d (GDesc -> LE -maddress-mode=long)" \
1474 "$NOPIE_LDFLAGS tmpdir/pr25416-5c.o tmpdir/pr25416-5d.o" \
1475 "-Wa,-mx86-used-note=yes" \
1476 { pr25416-5a.c } \
1477 "pr25416-5d" \
1478 "pass.out" \
1479 "$NOPIE_CFLAGS" \
1480 ] \
1481 [list \
1482 "Run pr25416-5e (GDesc -maddress-mode=short)" \
1483 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5d.so" \
1484 "-Wa,-mx86-used-note=yes" \
1485 { pr25416-5a.c } \
1486 "pr25416-5e" \
1487 "pass.out" \
1488 "$NOPIE_CFLAGS" \
1489 ] \
1490 [list \
1491 "Run pr25416-5f (PIE GDesc -> LE -maddress-mode=short)" \
1492 "-pie -Wl,-z,notext tmpdir/pr25416-5b.o tmpdir/pr25416-5d.o" \
1493 "-Wa,-mx86-used-note=yes" \
1494 { pr25416-5a.c } \
1495 "pr25416-5f" \
1496 "pass.out" \
1497 ] \
1498 [list \
1499 "Run pr25416-5g (PIE GDesc -> LE -maddress-mode=long)" \
1500 "-pie -Wl,-z,notext tmpdir/pr25416-5c.o tmpdir/pr25416-5d.o" \
1501 "-Wa,-mx86-used-note=yes" \
1502 { pr25416-5a.c } \
1503 "pr25416-5g" \
1504 "pass.out" \
1505 ] \
1506 ]
1507 } else {
1508 run_cc_link_tests [list \
1509 [list \
1510 "Build pr22001-1b" \
1511 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1512 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1513 { pr22001-1c.c } \
1514 {{error_output "pr22001-1b.err"}} \
1515 "pr22001-1b" \
1516 ] \
1517 [list \
1518 "Build pr21997-1b" \
1519 "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
1520 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1521 { pr21997-1c.c } \
1522 {{error_output "pr21997-1b.err"}} \
1523 "pr21997-1b" \
1524 ] \
1525 [list \
1526 "Build lam-u48.so" \
1527 "-shared -Wl,-z,lam-u48" \
1528 "" \
1529 {dummy.s} \
1530 {{readelf -n lam-u48.rd}} \
1531 "lam-u48.so" \
1532 ] \
1533 [list \
1534 "Build lam-u57.so" \
1535 "-shared -Wl,-z,lam-u57" \
1536 "" \
1537 {dummy.s} \
1538 {{readelf -n lam-u57.rd}} \
1539 "lam-u57.so" \
1540 ] \
1541 ]
1542 }
1543
1544 run_ld_link_exec_tests [list \
1545 [list \
1546 "Run plt-main" \
1547 "-Wl,--no-as-needed tmpdir/plt-main1.o tmpdir/plt-main2.o \
1548 tmpdir/plt-main3.o tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
1549 "-Wa,-mx86-used-note=yes" \
1550 { plt-main5.c } \
1551 "plt-main" \
1552 "plt-main.out" \
1553 ] \
1554 [list \
1555 "Run plt-main with PIE" \
1556 "-Wl,--no-as-needed -pie tmpdir/plt-main1.o tmpdir/plt-main2.o \
1557 tmpdir/plt-main3.o tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
1558 "-Wa,-mx86-used-note=yes" \
1559 { plt-main5.c } \
1560 "plt-main-pie" \
1561 "plt-main.out" \
1562 "-fPIC" \
1563 ] \
1564 [list \
1565 "Run copyreloc-main with PIE without -fPIE" \
1566 "-Wl,--as-needed -pie tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so" \
1567 "-Wa,-mx86-used-note=yes" \
1568 { dummy.s } \
1569 "copyreloc-main" \
1570 "copyreloc-main.out" \
1571 ] \
1572 [list \
1573 "Run pr17689 with PIE without -fPIE" \
1574 "-Wl,--no-as-needed -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \
1575 "-Wa,-mx86-used-note=yes" \
1576 { dummy.s } \
1577 "pr17689" \
1578 "pr17689.out" \
1579 ] \
1580 [list \
1581 "Run pr17689 with PIE -z now without -fPIE" \
1582 "-Wl,--as-needed,-z,now -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \
1583 "-Wa,-mx86-used-note=yes" \
1584 { dummy.s } \
1585 "pr17689now" \
1586 "pr17689.out" \
1587 ] \
1588 [list \
1589 "Run pr18900" \
1590 "-Wl,--no-as-needed tmpdir/pr18900.o tmpdir/pr18900.so" \
1591 "-Wa,-mx86-used-note=yes" \
1592 { dummy.s } \
1593 "pr18900" \
1594 "pr18900.out" \
1595 ] \
1596 [list \
1597 "Run pr19031" \
1598 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \
1599 "-Wa,-mx86-used-note=yes" \
1600 { pr19031b.S pr19031c.c } \
1601 "pr19031" \
1602 "pr19031.out" \
1603 "$NOPIE_CFLAGS" \
1604 ] \
1605 [list \
1606 "Run gotpcrel1" \
1607 "-Wl,--no-as-needed tmpdir/gotpcrel1d.so" \
1608 "-Wa,-mx86-used-note=yes" \
1609 { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c } \
1610 "gotpcrel1" \
1611 "gotpcrel1.out" \
1612 ] \
1613 [list \
1614 "Run property 1" \
1615 "" \
1616 "-Wa,-mx86-used-note=yes" \
1617 {pass.c property-no-copy.S} \
1618 "property-1" "pass.out" \
1619 ] \
1620 [list \
1621 "Run property 1 (PIE)" \
1622 "-pie" \
1623 "-Wa,-mx86-used-note=yes" \
1624 {pass.c property-no-copy.S} \
1625 "property-1-pie" "pass.out" "-fPIE" \
1626 ] \
1627 [list \
1628 "Run property 1 (static)" \
1629 "-static" \
1630 "-Wa,-mx86-used-note=yes" \
1631 {pass.c property-no-copy.S} \
1632 "property-1-static" "pass.out" \
1633 ] \
1634 [list \
1635 "Run property 2" \
1636 "" \
1637 "-Wa,-mx86-used-note=yes" \
1638 {pass.c property-stack.S} \
1639 "property-2" "pass.out" \
1640 ] \
1641 [list \
1642 "Run property 2 (PIE)" \
1643 "-pie" \
1644 "-Wa,-mx86-used-note=yes" \
1645 {pass.c property-stack.S} \
1646 "property-2-pie" "pass.out" "-fPIE" \
1647 ] \
1648 [list \
1649 "Run property 2 (static)" \
1650 "-static" \
1651 "-Wa,-mx86-used-note=yes" \
1652 {pass.c property-stack.S} \
1653 "property-3-static" "pass.out" \
1654 ] \
1655 [list \
1656 "Run pr22001-1a (PIC 1)" \
1657 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1658 "-Wa,-mx86-used-note=yes" \
1659 { pr22001-1b.c } \
1660 "pr22001-1a-pic-1" \
1661 "pass.out" \
1662 "-fPIC" \
1663 ] \
1664 [list \
1665 "Run pr22001-1a (PIC 2)" \
1666 "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1667 "-Wa,-mx86-used-note=yes" \
1668 { pr22001-1b.c } \
1669 "pr22001-1a-pic-2" \
1670 "pass.out" \
1671 "-fPIC" \
1672 ] \
1673 [list \
1674 "Run pr22001-1b (PIC 1)" \
1675 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1676 "-Wa,-mx86-used-note=yes" \
1677 { pr22001-1c.c } \
1678 "pr22001-1b-pic-1" \
1679 "pass.out" \
1680 "-fPIC" \
1681 ] \
1682 [list \
1683 "Run pr22001-1b (PIC 2)" \
1684 "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1685 "-Wa,-mx86-used-note=yes" \
1686 { pr22001-1c.c } \
1687 "pr22001-1b-pic-2" \
1688 "pass.out" \
1689 "-fPIC" \
1690 ] \
1691 [list \
1692 "Run pr21997-1a (PIC 1)" \
1693 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1694 "-Wa,-mx86-used-note=yes" \
1695 { pr21997-1b.c } \
1696 "pr21997-1a-pic-1" \
1697 "pass.out" \
1698 "-fPIC" \
1699 ] \
1700 [list \
1701 "Run pr21997-1a (PIC 2)" \
1702 "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1703 "-Wa,-mx86-used-note=yes" \
1704 { pr21997-1b.c } \
1705 "pr21997-1a-pic-2" \
1706 "pass.out" \
1707 "-fPIC" \
1708 ] \
1709 [list \
1710 "Run pr21997-1b (PIC 1)" \
1711 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1712 "-Wa,-mx86-used-note=yes" \
1713 { pr21997-1c.c } \
1714 "pr21997-1b-pic-1" \
1715 "pass.out" \
1716 "-fPIC" \
1717 ] \
1718 [list \
1719 "Run pr21997-1b (PIC 2)" \
1720 "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1721 "-Wa,-mx86-used-note=yes" \
1722 { pr21997-1c.c } \
1723 "pr21997-1b-pic-2" \
1724 "pass.out" \
1725 "-fPIC" \
1726 ] \
1727 [list \
1728 "Run pr22064" \
1729 "-pie -Wl,--no-as-needed tmpdir/pr22064a.o tmpdir/pr22064.so" \
1730 "-Wa,-mx86-used-note=yes" \
1731 { dummy.s } \
1732 "pr22064-pie" \
1733 "pass.out" \
1734 "-fPIE" \
1735 ] \
1736 [list \
1737 "Run pr22393-3" \
1738 "$NOPIE_LDFLAGS -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a.so" \
1739 "-Wa,-mx86-used-note=yes" \
1740 {pr22393-3b.c} \
1741 "pr22393-3" \
1742 "pass.out" \
1743 "$NOPIE_CFLAGS" \
1744 ] \
1745 [list \
1746 "Run pr22393-3 (PIE)" \
1747 "-pie -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a-now.so" \
1748 "-Wa,-mx86-used-note=yes" \
1749 {pr22393-3b.c} \
1750 "pr22393-3-pie" \
1751 "pass.out" \
1752 "-fPIE" \
1753 ] \
1754 [list \
1755 "Run pr22393-3 (static)" \
1756 "-static -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1757 "-Wa,-mx86-used-note=yes" \
1758 {pr22393-3a.c pr22393-3b.c} \
1759 "pr22393-3-static" \
1760 "pass.out" \
1761 ] \
1762 [list \
1763 "Run pr22791-2" \
1764 "-pie -Wl,--no-as-needed tmpdir/pr22791-2.so" \
1765 "-Wa,-mx86-used-note=yes" \
1766 { pr22791-2c.s } \
1767 "pr22791-2" \
1768 "pass.out" \
1769 "$NOPIE_CFLAGS" \
1770 ] \
1771 [list \
1772 "Run pr22842" \
1773 "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
1774 "-Wa,-mx86-used-note=yes" \
1775 { pr22842b.S } \
1776 "pr22842" \
1777 "pass.out" \
1778 ] \
1779 [list \
1780 "Run pr23997" \
1781 "" \
1782 "" \
1783 { pr23997a.s pr23997b.c pr23997c.c } \
1784 "pr23997" \
1785 "pass.out" \
1786 ] \
1787 [list \
1788 "Run protected-func-1 with PIE" \
1789 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-1.so" \
1790 "-Wa,-mx86-used-note=yes" \
1791 { protected-func-1b.c } \
1792 "protected-func-1b" \
1793 "pass.out" \
1794 "-fPIE" \
1795 ] \
1796 [list \
1797 "Run protected-func-2a without PIE" \
1798 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2a.so" \
1799 "-Wa,-mx86-used-note=yes" \
1800 { protected-func-2b.S } \
1801 "protected-func-2a" \
1802 "pass.out" \
1803 "$NOPIE_CFLAGS" \
1804 ] \
1805 [list \
1806 "Run protected-func-2b with PIE" \
1807 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-2a.so" \
1808 "-Wa,-mx86-used-note=yes" \
1809 { protected-func-2b.S } \
1810 "protected-func-2b" \
1811 "pass.out" \
1812 "-fPIE" \
1813 ] \
1814 [list \
1815 "Run protected-func-2c without PIE" \
1816 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
1817 "-Wa,-mx86-used-note=yes" \
1818 { protected-func-2b.S } \
1819 "protected-func-2c" \
1820 "pass.out" \
1821 "$NOPIE_CFLAGS" \
1822 ] \
1823 [list \
1824 "Run protected-func-2d with PIE" \
1825 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-2b.so" \
1826 "-Wa,-mx86-used-note=yes" \
1827 { protected-func-2b.S } \
1828 "protected-func-2d" \
1829 "pass.out" \
1830 "-fPIE" \
1831 ] \
1832 [list \
1833 "Run protected-func-3a without PIE" \
1834 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2a.so" \
1835 "-Wa,-mx86-used-note=yes" \
1836 { protected-func-3.c } \
1837 "protected-func-3a" \
1838 "pass.out" \
1839 "$NOPIE_CFLAGS" \
1840 ] \
1841 [list \
1842 "Run protected-func-3b with PIE" \
1843 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-2a.so" \
1844 "-Wa,-mx86-used-note=yes" \
1845 { protected-func-3.c } \
1846 "protected-func-2b" \
1847 "pass.out" \
1848 "-fPIE" \
1849 ] \
1850 [list \
1851 "Run protected-data-2a without PIE" \
1852 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-2a.so" \
1853 "-Wa,-mx86-used-note=yes" \
1854 { protected-data-2b.S } \
1855 "protected-data-2a" \
1856 "pass.out" \
1857 "$NOPIE_CFLAGS" \
1858 ] \
1859 [list \
1860 "Run protected-data-2b with PIE" \
1861 "-Wl,--no-as-needed -pie tmpdir/libprotected-data-2a.so" \
1862 "-Wa,-mx86-used-note=yes" \
1863 { protected-data-2b.S } \
1864 "protected-data-2b" \
1865 "pass.out" \
1866 "-fPIE" \
1867 ] \
1868 [list \
1869 "Run protected-data-2c without PIE" \
1870 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-2b.so" \
1871 "-Wa,-mx86-used-note=yes" \
1872 { protected-data-2b.S } \
1873 "protected-data-2c" \
1874 "pass.out" \
1875 "$NOPIE_CFLAGS" \
1876 ] \
1877 [list \
1878 "Run protected-data-2d with PIE" \
1879 "-Wl,--no-as-needed -pie tmpdir/libprotected-data-2b.so" \
1880 "-Wa,-mx86-used-note=yes" \
1881 { protected-data-2b.S } \
1882 "protected-data-2d" \
1883 "pass.out" \
1884 "-fPIE" \
1885 ] \
1886 ]
1887
1888 # Run-time tests which require working ifunc attribute support.
1889 if { [check_ifunc_attribute_available] } {
1890 run_cc_link_tests [list \
1891 [list \
1892 "Build libpr19784a.so" \
1893 "-shared -Wl,-Bsymbolic-functions" \
1894 "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
1895 { pr19784b.c pr19784c.c } \
1896 {} \
1897 "libpr19784a.so" \
1898 ] \
1899 [list \
1900 "Build libpr19784b.so" \
1901 "-shared -Wl,-Bsymbolic-functions" \
1902 "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
1903 { pr19784c.c pr19784b.c } \
1904 {} \
1905 "libpr19784b.so" \
1906 ] \
1907 [list \
1908 "Build pr19784a.o" \
1909 "" \
1910 "-Wa,-mx86-used-note=yes" \
1911 { pr19784a.c } \
1912 ] \
1913 ]
1914
1915 run_ld_link_exec_tests [list \
1916 [list \
1917 "Run pr19784a" \
1918 "-Wl,--no-as-needed tmpdir/pr19784a.o tmpdir/libpr19784a.so" \
1919 "-Wa,-mx86-used-note=yes" \
1920 { dummy.s } \
1921 "pr19784a" \
1922 "pass.out" \
1923 ] \
1924 [list \
1925 "Run pr19784b" \
1926 "-Wl,--as-needed tmpdir/pr19784a.o tmpdir/libpr19784b.so" \
1927 "-Wa,-mx86-used-note=yes" \
1928 { dummy.s } \
1929 "pr19784b" \
1930 "pass.out" \
1931 ] \
1932 ]
1933 }
1934
1935 if { [istarget "x86_64-*-linux*"] } {
1936 set pltdump {{objdump {-drw} plt-main-ibt.dd}}
1937 set pltsecdump {{readelf {-SW} plt-main-ibt-now.rd} {objdump {-drw} plt-main-ibt.dd}}
1938 run_cc_link_tests [list \
1939 [list \
1940 "Build plt-main with -z ibtplt" \
1941 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1942 tmpdir/plt-main4.o tmpdir/libplt-lib.so -Wl,-z,ibtplt \
1943 -Wl,-z,noseparate-code,-z,max-page-size=0x200000" \
1944 "-Wa,-mx86-used-note=yes" \
1945 { plt-main5.c } \
1946 $pltdump \
1947 "plt-main-ibt" \
1948 ] \
1949 [list \
1950 "Build plt-main with PIE and -z ibtplt" \
1951 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1952 tmpdir/plt-main4.o tmpdir/libplt-lib.so -pie \
1953 -Wl,-z,ibtplt,-z,noseparate-code \
1954 -Wl,-z,max-page-size=0x200000" \
1955 "-fPIC -Wa,-mx86-used-note=yes" \
1956 { plt-main5.c } \
1957 $pltdump \
1958 "plt-main-pie-ibt" \
1959 ] \
1960 [list \
1961 "Build plt-main with -z ibtplt -z now" \
1962 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1963 tmpdir/plt-main4.o tmpdir/libplt-lib.so -Wl,-z,ibtplt \
1964 -Wl,-z,now,-z,noseparate-code,-z,max-page-size=0x200000" \
1965 "-Wa,-mx86-used-note=yes" \
1966 { plt-main5.c } \
1967 $pltsecdump \
1968 "plt-main-ibt-now" \
1969 ] \
1970 [list \
1971 "Build plt-main with PIE and -z ibtplt -z now" \
1972 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1973 tmpdir/plt-main4.o tmpdir/libplt-lib.so -pie \
1974 -Wl,-z,ibtplt,-z,now,-z,noseparate-code \
1975 -Wl,-z,max-page-size=0x200000" \
1976 "-fPIC -Wa,-mx86-used-note=yes" \
1977 { plt-main5.c } \
1978 $pltsecdump \
1979 "plt-main-pie-ibt-now" \
1980 ] \
1981 [list \
1982 "Build libibtplt-lib.so with -z ibtplt" \
1983 "-shared -Wl,-z,ibtplt,-z,noseparate-code \
1984 -Wl,-z,max-page-size=0x200000" \
1985 "-fPIC -Wa,-mx86-used-note=yes" \
1986 { plt-main1.c plt-main2.c plt-main3.c plt-main4.c} \
1987 $pltdump \
1988 "libibtplt-lib.so" \
1989 ] \
1990 [list \
1991 "Build libibtplt--now-lib.so with -z ibtplt -z now" \
1992 "-shared -Wl,-z,ibtplt,-z,now,-z,noseparate-code \
1993 -Wl,-z,max-page-size=0x200000" \
1994 "-fPIC -Wa,-mx86-used-note=yes" \
1995 { plt-main1.c plt-main2.c plt-main3.c plt-main4.c} \
1996 $pltdump \
1997 "libibtplt-now-lib.so" \
1998 ] \
1999 ]
2000
2001 run_ld_link_exec_tests [list \
2002 [list \
2003 "Run plt-main with -z ibtplt" \
2004 "-Wl,--no-as-needed,-z,ibtplt tmpdir/plt-main1.o \
2005 tmpdir/plt-main2.o tmpdir/plt-main3.o \
2006 tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
2007 "-Wa,-mx86-used-note=yes" \
2008 { plt-main5.c } \
2009 "plt-main-ibt" \
2010 "plt-main.out" \
2011 ] \
2012 [list \
2013 "Run plt-main with PIE and -z ibtplt" \
2014 "-Wl,--no-as-needed,-z,ibtplt -pie tmpdir/plt-main1.o \
2015 tmpdir/plt-main2.o tmpdir/plt-main3.o \
2016 tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
2017 "-Wa,-mx86-used-note=yes" \
2018 { plt-main5.c } \
2019 "plt-main-pie-ibt" \
2020 "plt-main.out" \
2021 "-fPIC" \
2022 ] \
2023 [list \
2024 "Run plt-main with -z ibtplt -z now" \
2025 "-Wl,--no-as-needed,-z,ibtplt,-z,now tmpdir/plt-main1.o \
2026 tmpdir/plt-main2.o tmpdir/plt-main3.o \
2027 tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
2028 "-Wa,-mx86-used-note=yes" \
2029 { plt-main5.c } \
2030 "plt-main-ibt-now" \
2031 "plt-main.out" \
2032 ] \
2033 [list \
2034 "Run plt-main with PIE and -z ibtplt -z now" \
2035 "-Wl,--no-as-needed,-z,ibtplt,-z,now -pie tmpdir/plt-main1.o \
2036 tmpdir/plt-main2.o tmpdir/plt-main3.o \
2037 tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
2038 "-Wa,-mx86-used-note=yes" \
2039 { plt-main5.c } \
2040 "plt-main-pie-ibt-now" \
2041 "plt-main.out" \
2042 "-fPIC" \
2043 ] \
2044 [list \
2045 "Run plt-main with libibtplt-lib.so -z ibtplt" \
2046 "-Wl,--no-as-needed,-z,ibtplt tmpdir/libibtplt-lib.so \
2047 tmpdir/libplt-lib.so" \
2048 "-Wa,-mx86-used-note=yes" \
2049 { plt-main5.c } \
2050 "plt-main-ibt-lib" \
2051 "plt-main.out" \
2052 ] \
2053 [list \
2054 "Run plt-main with libibtplt-lib.so -z ibtplt -z now" \
2055 "-Wl,--no-as-needed,-z,ibtplt,-z,now \
2056 tmpdir/libibtplt-now-lib.so tmpdir/libplt-lib.so" \
2057 "-Wa,-mx86-used-note=yes" \
2058 { plt-main5.c } \
2059 "plt-main-ibt-now-lib" \
2060 "plt-main.out" \
2061 ] \
2062 ]
2063
2064 if { [check_ifunc_attribute_available] } {
2065 run_ld_link_exec_tests [list \
2066 [list \
2067 "Run pr21481a" \
2068 "$NOPIE_LDFLAGS -Wl,-z,ibtplt" \
2069 "-Wa,-mx86-used-note=yes" \
2070 { pr21481a.c pr21481b.S } \
2071 "pr21481a" \
2072 "pass.out" \
2073 "$NOPIE_CFLAGS" \
2074 ] \
2075 [list \
2076 "Run pr21481b" \
2077 "$NOPIE_LDFLAGS -Wl,-z,ibtplt,-z,now" \
2078 "-Wa,-mx86-used-note=yes" \
2079 { pr21481a.c pr21481b.S } \
2080 "pr21481b" \
2081 "pass.out" \
2082 "$NOPIE_CFLAGS" \
2083 ] \
2084 ]
2085 }
2086 }
2087
2088 undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
2089 undefined_weak "-fPIE" ""
2090 undefined_weak "-fPIE" "-pie"
2091 undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak"
2092 undefined_weak "-fPIE" "-pie -Wl,-z,nodynamic-undefined-weak"
2093 }
2094
2095 if { ![istarget "x86_64-*-linux*"]} {
2096 set ASFLAGS "$saved_ASFLAGS"
2097 return
2098 }
2099
2100 run_ld_link_tests [list \
2101 [list \
2102 "basic PLT generation (-z now)" \
2103 "-z now -melf_x86_64 --hash-style=sysv tmpdir/libpltlib.so \
2104 -z nomark-plt \
2105 -z noseparate-code -z max-page-size=0x200000" \
2106 "" \
2107 "--64" \
2108 {plt2.s} \
2109 {{readelf -SW plt2.rd} {objdump -dwr plt2.dd}} \
2110 "plt2" \
2111 ] \
2112 [list \
2113 "Build property 3" \
2114 "-m elf_x86_64" \
2115 "" \
2116 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2117 {property-stk.s property-x86-1.s} \
2118 {{readelf -n property-3.r}} \
2119 "property-3" \
2120 ] \
2121 [list \
2122 "Build property 3 (.o)" \
2123 "-m elf_x86_64 -r" \
2124 "" \
2125 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2126 {property-x86-1.s property-stk.s} \
2127 {{readelf -n property-3a.r}} \
2128 "property-3.o" \
2129 ] \
2130 [list \
2131 "Build property 3 (.so)" \
2132 "-m elf_x86_64 -shared" \
2133 "" \
2134 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2135 {property-x86-1.s property-stk.s} \
2136 {{readelf -n property-3.r}} \
2137 "property-3.so" \
2138 ] \
2139 [list \
2140 "Build property 4" \
2141 "-m elf_x86_64" \
2142 "" \
2143 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2144 {property-stk.s property-x86-1.s property-x86-2.s} \
2145 {{readelf -n property-4.r}} \
2146 "property-4" \
2147 ] \
2148 [list \
2149 "Build property 4 (.o)" \
2150 "-m elf_x86_64 -r" \
2151 "" \
2152 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2153 {property-x86-2.s property-x86-1.s property-stk.s} \
2154 {{readelf {-n} property-4a.r}} \
2155 "property-4.o" \
2156 ] \
2157 [list \
2158 "Build property 4 (.so)" \
2159 "-m elf_x86_64 -shared" \
2160 "" \
2161 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2162 {property-x86-2.s property-x86-1.s property-stk.s} \
2163 {{readelf -n property-4.r}} \
2164 "property-4.so" \
2165 ] \
2166 [list \
2167 "Build property 4 (-z stack-size=0)" \
2168 "-m elf_x86_64 -z stack-size=0" \
2169 "" \
2170 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2171 {property-stk.s property-x86-1.s property-x86-2.s} \
2172 {{readelf -n property-4.r}} \
2173 "property-4" \
2174 ] \
2175 [list \
2176 "Build property 5" \
2177 "-m elf_x86_64 -z stack-size=0x900000" \
2178 "" \
2179 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2180 {property-stk.s property-x86-1.s property-x86-2.s} \
2181 {{readelf -n property-5.r}} \
2182 "property-5" \
2183 ] \
2184 [list \
2185 "Build property 5 (.o)" \
2186 "-m elf_x86_64 -r -z stack-size=0x900000" \
2187 "" \
2188 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2189 {property-x86-2.s property-x86-1.s property-stk.s} \
2190 {{readelf {-n} property-5a.r}} \
2191 "property-5.o" \
2192 ] \
2193 [list \
2194 "Build property 5 (.so)" \
2195 "-m elf_x86_64 -shared -z stack-size=0x900000" \
2196 "" \
2197 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2198 {property-x86-2.s property-x86-1.s property-stk.s} \
2199 {{readelf -n property-5.r}} \
2200 "property-5.so" \
2201 ] \
2202 [list \
2203 "Build pr21626.so" \
2204 "-shared -melf_x86_64" \
2205 "" \
2206 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2207 {property-x86-3.s} \
2208 "" \
2209 "pr21626.so" \
2210 ] \
2211 [list \
2212 "Build pr21626" \
2213 "-melf_x86_64 tmpdir/pr21626.so" \
2214 "" \
2215 "--64 -mx86-used-note=yes" \
2216 {start.s foo.s} \
2217 "" \
2218 "pr21626" \
2219 ] \
2220 ]
2221
2222 # Linux only tests. Disabled due to large memory requirement.
2223 if { "x$LD_CLASS" == "64bit" } then {
2224 # This test needs 64-bit linker.
2225 run_dump_test "pr17618"
2226 }
2227 run_dump_test "pltgot-1"
2228 run_dump_test "pltgot-2"
2229 run_dump_test "pr20830a"
2230 run_dump_test "pr20830b"
2231 run_dump_test "pr20830a-now"
2232 run_dump_test "pr20830b-now"
2233 run_dump_test "ibt-plt-1"
2234 run_dump_test "ibt-plt-1-x32"
2235 run_dump_test "ibt-plt-2a"
2236 run_dump_test "ibt-plt-2b"
2237 run_dump_test "ibt-plt-2c"
2238 run_dump_test "ibt-plt-2d"
2239 run_dump_test "ibt-plt-2a-x32"
2240 run_dump_test "ibt-plt-2b-x32"
2241 run_dump_test "ibt-plt-2c-x32"
2242 run_dump_test "ibt-plt-2d-x32"
2243 run_dump_test "ibt-plt-3a"
2244 run_dump_test "ibt-plt-3b"
2245 run_dump_test "ibt-plt-3c"
2246 run_dump_test "ibt-plt-3d"
2247 run_dump_test "ibt-plt-3a-x32"
2248 run_dump_test "ibt-plt-3b-x32"
2249 run_dump_test "ibt-plt-3c-x32"
2250 run_dump_test "ibt-plt-3d-x32"
2251 run_dump_test "mark-plt-1a"
2252 run_dump_test "mark-plt-1b"
2253 run_dump_test "mark-plt-1c"
2254 run_dump_test "mark-plt-1d"
2255 run_dump_test "mark-plt-1a-x32"
2256 run_dump_test "mark-plt-1b-x32"
2257 run_dump_test "mark-plt-1c-x32"
2258 run_dump_test "mark-plt-1d-x32"
2259
2260 set ASFLAGS "$saved_ASFLAGS"