1 # Expect script for ld-x86_64 tests
2 # Copyright (C) 2002-2024 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
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.
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.
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,
22 # Test x86_64 linking; all types of relocs. This tests the assembler and
23 # tools like objdump as well as the linker.
25 if { !([istarget "x86_64-*-elf*"] || [istarget "x86_64-*-linux*"]) } {
30 set saved_ASFLAGS "$ASFLAGS"
31 set ASFLAGS "$ASFLAGS -mx86-used-note=no"
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
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).
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 \
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}}
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}}
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}}
72 {"TLS with global dynamic and descriptors"
73 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
75 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv" ""
77 {{readelf -WSsrl tlsgdesc.rd} {objdump -drj.text\ -Mintel64 tlsgdesc.dd}}
79 {"TLS in debug sections" "-melf_x86_64" ""
81 {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"}
82 {"TLS GD->LE transition" "-melf_x86_64" ""
84 {{objdump -dwr tlsgd1.dd}} "tlsgd1"}
85 {"TLS LD->LE transition" "-melf_x86_64" ""
87 {{objdump -dwr tlsld1.dd}} "tlsld1"}
88 {"TLS IE->LE transition" "-melf_x86_64" ""
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" ""
105 {{objdump -dwr tlsie4.dd}} "tlsie4"}
106 {"TLS X32 GD->LE transition" "-melf32_x86_64" ""
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" ""
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" ""
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" ""
129 {{objdump -dwr tlsld2.dd}} "tlsld2"}
130 {"TLS -mcmodel=large GD->LE transition" "-melf_x86_64" ""
132 {{objdump -dwr tlsgd7.dd}} "tlsgd7"}
133 {"TLS -mcmodel=large LD->LE transition" "-melf_x86_64" ""
135 {{objdump -dwr tlsld3.dd}} "tlsld3"}
136 {"TLS -mcmodel=large LD->LE transition with r15 as GOT base"
139 {{objdump -dwr tlsld4.dd}} "tlsld4"}
140 {"TLS LD->LE transition without PLT"
142 "--64 -mrelax-relocations=yes"
144 {{objdump -dwr tlsld5.dd}} "tlsld5"}
145 {"TLS X32 LD->LE transition without PLT" "-melf32_x86_64" ""
146 "--x32 -mrelax-relocations=yes"
148 {{objdump -dwr tlsld6.dd}} "tlsld6"}
149 {"TLS -mcmodel=large GD->IE transition" "-melf_x86_64 tmpdir/libtlsgd5.so" ""
151 {{objdump -dwrj.text tlsgd8.dd}} "tlsgd8"}
152 {"TLS -mcmodel=large GD->LE transition with r15 as GOT base"
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" ""
159 {{objdump -dwrj.text tlsgd10.dd}} "tlsgd10"}
160 {"TLS GD->LE transition without PLT"
163 {{objdump -dwr tlsgd11.dd}} "tlsgd11"}
164 {"TLS X32 GD->LE transition without PLT"
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"}
188 "-melf_x86_64 -pie -z notext tmpdir/pr19827a.o tmpdir/pr19827b.so"
190 "--64" { dummy.s } {{readelf {-rW} pr19827.rd}} "pr19827"}
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"}
201 "-melf_x86_64 -pie -z notext tmpdir/pr20550a.o tmpdir/pr20550b.so"
203 "--64" { dummy.s } {} "pr20550"}
205 "-melf_x86_64 -e main"
207 { pr27587a.obj.bz2 pr27587b.obj.bz2 }
208 {{ld "pr27587.err"}} "pr27587"}
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"}
221 run_ld_link_tests $x86_64tests
223 run_ld_link_tests [list \
225 "TLS -fpic -shared transitions" \
226 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
228 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv \
229 $NO_DT_RELR_LDFLAGS" \
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}} \
239 "TLS -fpic -shared transitions with r15 as GOT base" \
240 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
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}} \
253 "TLS descriptor -fpic -shared transitions" \
254 "-shared -melf_x86_64 --no-ld-generated-unwind-info \
256 -z noseparate-code -z max-page-size=0x200000 --hash-style=sysv \
257 $NO_DT_RELR_LDFLAGS" \
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}} \
269 set test_name "Mixed x86_64 and i386 input test 1"
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] {
279 set test_name "Mixed x86_64 and i386 input test 2"
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] {
291 run_dump_test "pcrel8"
292 run_dump_test "pcrel16"
293 run_dump_test "pcrel16-2"
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"
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"
515 if { ![skip_sframe_tests] } {
516 run_dump_test "sframe-simple-1"
517 run_dump_test "sframe-plt-1"
520 if ![istarget "x86_64-*-linux*"] {
524 if ![ld_assemble $as "--x32 $srcdir/$subdir/start.s" tmpdir/startx32.o] {
525 fail "Build ILP32 start.o"
529 if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] {
530 fail "Build ia32 start.o"
534 if ![ld_assemble $as "--64 $srcdir/$subdir/start.s" tmpdir/start64.o] {
535 fail "Build LP64 start.o"
539 if ![ld_assemble $as "--x32 $srcdir/$subdir/foo.s" tmpdir/foox32.o] {
540 fail "Build ILP32 foo.o"
544 if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] {
545 fail "Build ia32 foo.o"
549 if ![ld_assemble $as "--64 $srcdir/$subdir/foo.s" tmpdir/foo64.o] {
550 fail "Build LP64 foo.o"
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"
743 proc undefined_weak {cflags ldflags} {
744 set testname "Undefined weak symbol"
745 if { ![ string match "" $cflags$ldflags] } {
746 set testname "$testname ($cflags $ldflags)"
749 if { [string match "*-fPIE*" $cflags]
750 && ![string match "*nodynamic-undefined-weak*" $ldflags] } {
751 set weak_symbol "Weak defined"
753 set weak_symbol "Weak undefined"
756 run_cc_link_tests [list \
758 "Build libpr19704a.so" \
759 "-shared -Wl,-soname,libpr19704.so" \
766 "Build libpr19704b.so" \
767 "-shared -Wl,-soname,libpr19704.so" \
775 exec cp tmpdir/libpr19704a.so tmpdir/libpr19704.so
777 run_ld_link_exec_tests [list \
780 "-Wl,--no-as-needed,-R,tmpdir $ldflags tmpdir/libpr19704.so" \
789 exec cp tmpdir/libpr19704b.so tmpdir/libpr19704.so
791 set exec_output [run_host_cmd tmpdir/pr19704 ""]
792 if {![string match $weak_symbol $exec_output]} {
799 # Must be native with the C compiler
800 if { [isnative] && [check_compiler_available] } {
801 run_cc_link_tests [list \
803 "Helper X32 DSO from x86-64 object" "" \
804 "-m64 $NOSANITIZE_CFLAGS -fPIC -g" \
805 {simple.c} {} "libsimple.a" \
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 {
814 fail "Convert x86-64 object to x32"
818 run_ld_link_tests [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}} \
829 run_cc_link_tests [list \
833 "-fPIC -Wa,-mx86-used-note=yes" \
839 "Build libplt-main1.a" \
841 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
843 {{readelf {-Wr} plt-main1.rd}} \
847 "Build libplt-main2.a" \
849 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
851 {{readelf {-Wr} plt-main2.rd}} \
855 "Build libplt-main3.a" \
857 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes $PLT_CFLAGS" \
859 {{readelf {-Wr} plt-main3.rd}} \
863 "Build libplt-main4.a" \
865 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes $PLT_CFLAGS" \
867 {{readelf {-Wr} plt-main4.rd}} \
872 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
873 tmpdir/plt-main4.o tmpdir/libplt-lib.so" \
876 {{readelf {-Wr} plt-main.rd}} \
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" \
885 {{readelf {-Wr} plt-main.rd}} \
889 "Build copyreloc-lib.so" \
891 "-fPIC -Wa,-mx86-used-note=yes" \
892 { copyreloc-lib.c } \
897 "Build libcopyreloc-main.a" \
899 "-Wa,-mx86-used-note=yes" \
900 { copyreloc-main.S } \
902 "libcopyreloc-main.a" \
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" \
909 {{readelf {-Wr} copyreloc-main1.rd}} \
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" \
917 {{readelf {-Wr} copyreloc-main2.rd}} \
923 "-fPIC -Wa,-mx86-used-note=yes" \
929 "Build pr17689now.so with -z now" \
930 "-shared -Wl,-z,now" \
931 "-fPIC -Wa,-mx86-used-note=yes" \
933 {{readelf {-Wr} pr17689now.rd}} \
939 "-Wa,-mx86-used-note=yes" \
944 "Build pr17689 with PIE without -fPIE" \
945 "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
946 "-Wa,-mx86-used-note=yes" \
948 {{readelf {-Wr} pr17689.rd}} \
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" \
956 {{readelf {-Wr} pr17689now.rd}} \
960 "Build pr17827 with PIE without -fPIE" \
961 "-Wl,--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
962 "-Wa,-mx86-used-note=yes" \
964 {{readelf {-Wr} pr17827.rd}} \
970 "-fPIC -Wa,-mx86-used-note=yes" \
978 "-Wa,-mx86-used-note=yes" \
979 { pr18900b.c pr18900c.c } \
985 "tmpdir/pr18900.o tmpdir/pr18900.so" \
986 "-Wa,-mx86-used-note=yes" \
988 {{readelf {-Wrd} pr18900a.rd}} \
993 "-Wl,--as-needed tmpdir/pr18900.o tmpdir/pr18900.so" \
994 "-Wa,-mx86-used-note=yes" \
996 {{readelf {-Wrd} pr18900b.rd}} \
1000 "Build pr19031.so" \
1002 "-fPIC -Wa,-mx86-used-note=yes" \
1008 "Build gotpcrel1d.so" \
1010 "-Wa,-mx86-used-note=yes" \
1016 "Build gotpcrel1a.o gotpcrel1b.o gotpcrel1c.o" \
1018 "-Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
1019 { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c } \
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" \
1028 {{objdump {-dw} gotpcrel1.dd}} \
1032 "Build pr19319.so" \
1034 "-Wa,-mx86-used-note=yes" \
1041 "-pie -nostdlib -nostartfiles tmpdir/pr19319.so" \
1042 "-Wa,-mx86-used-note=yes" \
1044 {{objdump {-dw} pr19319.dd}} \
1048 "Build pr24276.so" \
1049 "-shared -nostdlib -nostartfiles \
1050 -Ltmpdir $srcdir/$subdir/pr24276.dso" \
1051 "-Wa,-mx86-used-note=yes" \
1053 {{warning_output pr24276.warn}} \
1057 "Build property 1" \
1059 "-Wa,-mx86-used-note=no" \
1060 {pass.c property-no-copy.S} \
1061 {{readelf {-n} property-1.r}} \
1065 "Build property 1 (.o)" \
1067 "-Wa,-mx86-used-note=yes" \
1068 {pass.c property-no-copy.S} \
1069 {{readelf {-n} property-1a.r}} \
1073 "Build property 1 (.so)" \
1075 "-fPIC -Wa,-mx86-used-note=no" \
1076 {pass.c property-no-copy.S} \
1077 {{readelf {-n} property-1.r}} \
1081 "Build property 2" \
1083 "-Wa,-mx86-used-note=no" \
1084 {pass.c property-stack.S} \
1085 {{readelf {-n} property-2.r}} \
1089 "Build property 2 (.o)" \
1091 "-Wa,-mx86-used-note=yes" \
1092 {pass.c property-stack.S} \
1093 {{readelf {-n} property-2a.r}} \
1097 "Build property 2 (.so)" \
1099 "-fPIC -Wa,-mx86-used-note=yes" \
1100 {pass.c property-stack.S} \
1101 {{readelf {-n} property-2.r}} \
1105 "Build property-6.so" \
1107 "-fPIC -Wa,-mx86-used-note=yes" \
1108 {property-6a.c property-6c.S} \
1109 {{readelf {-n} property-6.r}} \
1113 "Build property-6.o" \
1115 "-Wa,-mx86-used-note=yes" \
1116 {property-6b.c property-stack.S} \
1117 {{readelf {-n} property-2a.r}} \
1121 "Build property-6" \
1122 "-Wl,--as-needed tmpdir/property-6.o tmpdir/property-6.so" \
1123 "-Wa,-mx86-used-note=yes" \
1125 {{readelf {-n} property-2.r}} \
1129 "Build property 7a (.o)" \
1131 "-Wa,-mx86-used-note=yes" \
1132 {property-unsorted-1.S} \
1133 {{readelf {-n} property-7a.r}} \
1137 "Build property 7b (.o)" \
1139 "-Wa,-mx86-used-note=yes" \
1140 {property-unsorted-2.S} \
1141 {{readelf {-n} property-7a.r}} \
1145 "Build pr22001-1.so" \
1147 "-fPIC -Wa,-mx86-used-note=yes" \
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" \
1157 {{error_output "pr22001-1a.err"}} \
1161 "Build pr21997-1.so" \
1163 "-Wa,-mx86-used-note=yes" \
1164 { property-stack.S property-no-copy.S pr21997-1a.S } \
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" \
1173 {{error_output "pr21997-1a.err"}} \
1177 "Build pr22064a.o" \
1179 "-Wa,-mx86-used-note=yes" \
1183 "Build pr22064.so" \
1185 "-fPIC -Wa,-mx86-used-note=yes" \
1191 "Build pr22393-3a.so" \
1192 "-shared -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1193 "-fPIC -Wa,-mx86-used-note=yes" \
1195 {{readelf -lW pr22393-3a.rd} \
1196 {readelf -lW pr22393-3b.rd}} \
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" \
1204 {{readelf -lW pr22393-3a.rd} \
1205 {readelf -lW pr22393-3b.rd}} \
1206 "pr22393-3a-now.so" \
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" \
1213 {{readelf -lW pr22393-3a.rd} \
1214 {readelf -lW pr22393-3b.rd}} \
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" \
1222 {{readelf -lW pr22393-3a.rd} \
1223 {readelf -lW pr22393-3b.rd}} \
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" \
1236 "Build pr22791-1.so" \
1238 "-fPIC -Wa,-mx86-used-note=yes" \
1245 "-pie -Wl,--no-as-needed,-z,notext tmpdir/pr22791-1.so" \
1246 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1248 {{error_output "pr22791-1.err"}} \
1252 "Build pr22791-2a.o" \
1254 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1258 "Build pr22791-2.so" \
1259 "-shared tmpdir/pr22791-2a.o" \
1260 "-fPIC -Wa,-mx86-used-note=yes" \
1262 {{readelf -drW pr22791-2.rd}} \
1267 "-pie -Wl,--no-as-needed tmpdir/pr22791-2.so" \
1268 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1270 {{readelf -drW pr22791-2.rd}} \
1274 "Build pr22842.so" \
1276 "-fPIC -Wa,-mx86-used-note=yes" \
1283 "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
1284 "-Wa,-mx86-used-note=yes" \
1286 {{readelf -rW pr22842a.rd} \
1287 {readelf -rW pr22842b.rd}} \
1291 "Build libprotected-func-1.so" \
1293 "-fPIC -Wa,-mx86-used-note=yes" \
1294 { protected-func-1a.s } \
1296 "libprotected-func-1.so" \
1299 "Build libprotected-func-2a.so" \
1301 "-fPIC -Wa,-mx86-used-note=yes" \
1302 { protected-func-2a.S } \
1303 {{readelf -n indirect-extern-access.rd}} \
1304 "libprotected-func-2a.so" \
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" \
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" \
1323 "Build libprotected-func-2c.so" \
1325 "-fPIC -Wa,-mx86-used-note=yes" \
1326 { protected-func-2c.c } \
1328 "libprotected-func-2c.so" \
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" \
1339 "Build libprotected-data-1a.so" \
1340 "-shared -z noindirect-extern-access" \
1341 "-fPIC -Wa,-mx86-used-note=yes" \
1342 { protected-data-1a.c } \
1344 "libprotected-data-1a.so" \
1347 "Build libprotected-data-1b.so" \
1348 "-shared -z indirect-extern-access" \
1349 "-fPIC -Wa,-mx86-used-note=yes" \
1350 { protected-data-1a.c } \
1352 "libprotected-data-1b.so" \
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" \
1363 "Build libprotected-data-2a.so" \
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" \
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" \
1381 if {[istarget "x86_64-*-linux*-gnux32"]} {
1382 run_cc_link_tests [list \
1384 "Build pr25416-5b.o (GDesc -maddress-mode=short)" \
1386 "-Wa,-mx86-used-note=yes" \
1390 "Build pr25416-5b.so (GDesc -> IE -maddress-mode=short)" \
1392 "-fPIC -Wa,-mx86-used-note=yes" \
1393 { pr25416-5b.s pr25416-5d.s } \
1398 "Build pr25416-5c.o (GDesc -maddress-mode=long)" \
1400 "-Wa,-mx86-used-note=yes" \
1404 "Build pr25416-5c.so (GDesc -> IE -maddress-mode=long)" \
1406 "-fPIC -Wa,-mx86-used-note=yes" \
1407 { pr25416-5c.s pr25416-5d.s } \
1412 "Build pr25416-5d.so (GDesc -maddress-mode=short)" \
1414 "-fPIC -Wa,-mx86-used-note=yes" \
1415 { pr25416-5b.s pr25416-5e.s } \
1420 "Build pr25416-5d.o (IE -maddress-mode=short)" \
1422 "-Wa,-mx86-used-note=yes" \
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" \
1430 {{error_output "pr21997-1b.err"}} \
1435 run_ld_link_exec_tests [list \
1438 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1439 "-Wa,-mx86-used-note=yes" \
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" \
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" \
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" \
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" \
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" \
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" \
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" \
1508 run_cc_link_tests [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" \
1514 {{error_output "pr22001-1b.err"}} \
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" \
1522 {{error_output "pr21997-1b.err"}} \
1526 "Build lam-u48.so" \
1527 "-shared -Wl,-z,lam-u48" \
1530 {{readelf -n lam-u48.rd}} \
1534 "Build lam-u57.so" \
1535 "-shared -Wl,-z,lam-u57" \
1538 {{readelf -n lam-u57.rd}} \
1544 run_ld_link_exec_tests [list \
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" \
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" \
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" \
1570 "copyreloc-main.out" \
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" \
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" \
1590 "-Wl,--no-as-needed tmpdir/pr18900.o tmpdir/pr18900.so" \
1591 "-Wa,-mx86-used-note=yes" \
1598 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \
1599 "-Wa,-mx86-used-note=yes" \
1600 { pr19031b.S pr19031c.c } \
1607 "-Wl,--no-as-needed tmpdir/gotpcrel1d.so" \
1608 "-Wa,-mx86-used-note=yes" \
1609 { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c } \
1616 "-Wa,-mx86-used-note=yes" \
1617 {pass.c property-no-copy.S} \
1618 "property-1" "pass.out" \
1621 "Run property 1 (PIE)" \
1623 "-Wa,-mx86-used-note=yes" \
1624 {pass.c property-no-copy.S} \
1625 "property-1-pie" "pass.out" "-fPIE" \
1628 "Run property 1 (static)" \
1630 "-Wa,-mx86-used-note=yes" \
1631 {pass.c property-no-copy.S} \
1632 "property-1-static" "pass.out" \
1637 "-Wa,-mx86-used-note=yes" \
1638 {pass.c property-stack.S} \
1639 "property-2" "pass.out" \
1642 "Run property 2 (PIE)" \
1644 "-Wa,-mx86-used-note=yes" \
1645 {pass.c property-stack.S} \
1646 "property-2-pie" "pass.out" "-fPIE" \
1649 "Run property 2 (static)" \
1651 "-Wa,-mx86-used-note=yes" \
1652 {pass.c property-stack.S} \
1653 "property-3-static" "pass.out" \
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" \
1660 "pr22001-1a-pic-1" \
1665 "Run pr22001-1a (PIC 2)" \
1666 "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1667 "-Wa,-mx86-used-note=yes" \
1669 "pr22001-1a-pic-2" \
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" \
1678 "pr22001-1b-pic-1" \
1683 "Run pr22001-1b (PIC 2)" \
1684 "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1685 "-Wa,-mx86-used-note=yes" \
1687 "pr22001-1b-pic-2" \
1692 "Run pr21997-1a (PIC 1)" \
1693 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1694 "-Wa,-mx86-used-note=yes" \
1696 "pr21997-1a-pic-1" \
1701 "Run pr21997-1a (PIC 2)" \
1702 "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1703 "-Wa,-mx86-used-note=yes" \
1705 "pr21997-1a-pic-2" \
1710 "Run pr21997-1b (PIC 1)" \
1711 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1712 "-Wa,-mx86-used-note=yes" \
1714 "pr21997-1b-pic-1" \
1719 "Run pr21997-1b (PIC 2)" \
1720 "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1721 "-Wa,-mx86-used-note=yes" \
1723 "pr21997-1b-pic-2" \
1729 "-pie -Wl,--no-as-needed tmpdir/pr22064a.o tmpdir/pr22064.so" \
1730 "-Wa,-mx86-used-note=yes" \
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" \
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" \
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" \
1764 "-pie -Wl,--no-as-needed tmpdir/pr22791-2.so" \
1765 "-Wa,-mx86-used-note=yes" \
1773 "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
1774 "-Wa,-mx86-used-note=yes" \
1783 { pr23997a.s pr23997b.c pr23997c.c } \
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" \
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" \
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" \
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" \
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" \
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" \
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" \
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" \
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" \
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" \
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" \
1888 # Run-time tests which require working ifunc attribute support.
1889 if { [check_ifunc_attribute_available] } {
1890 run_cc_link_tests [list \
1892 "Build libpr19784a.so" \
1893 "-shared -Wl,-Bsymbolic-functions" \
1894 "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
1895 { pr19784b.c pr19784c.c } \
1900 "Build libpr19784b.so" \
1901 "-shared -Wl,-Bsymbolic-functions" \
1902 "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
1903 { pr19784c.c pr19784b.c } \
1908 "Build pr19784a.o" \
1910 "-Wa,-mx86-used-note=yes" \
1915 run_ld_link_exec_tests [list \
1918 "-Wl,--no-as-needed tmpdir/pr19784a.o tmpdir/libpr19784a.so" \
1919 "-Wa,-mx86-used-note=yes" \
1926 "-Wl,--as-needed tmpdir/pr19784a.o tmpdir/libpr19784b.so" \
1927 "-Wa,-mx86-used-note=yes" \
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 \
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" \
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" \
1958 "plt-main-pie-ibt" \
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" \
1968 "plt-main-ibt-now" \
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" \
1979 "plt-main-pie-ibt-now" \
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} \
1988 "libibtplt-lib.so" \
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} \
1997 "libibtplt-now-lib.so" \
2001 run_ld_link_exec_tests [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" \
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" \
2019 "plt-main-pie-ibt" \
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" \
2030 "plt-main-ibt-now" \
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" \
2040 "plt-main-pie-ibt-now" \
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" \
2050 "plt-main-ibt-lib" \
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" \
2059 "plt-main-ibt-now-lib" \
2064 if { [check_ifunc_attribute_available] } {
2065 run_ld_link_exec_tests [list \
2068 "$NOPIE_LDFLAGS -Wl,-z,ibtplt" \
2069 "-Wa,-mx86-used-note=yes" \
2070 { pr21481a.c pr21481b.S } \
2077 "$NOPIE_LDFLAGS -Wl,-z,ibtplt,-z,now" \
2078 "-Wa,-mx86-used-note=yes" \
2079 { pr21481a.c pr21481b.S } \
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"
2095 if { ![istarget "x86_64-*-linux*"]} {
2096 set ASFLAGS "$saved_ASFLAGS"
2100 run_ld_link_tests [list \
2102 "basic PLT generation (-z now)" \
2103 "-z now -melf_x86_64 --hash-style=sysv tmpdir/libpltlib.so \
2105 -z noseparate-code -z max-page-size=0x200000" \
2109 {{readelf -SW plt2.rd} {objdump -dwr plt2.dd}} \
2113 "Build property 3" \
2116 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2117 {property-stk.s property-x86-1.s} \
2118 {{readelf -n property-3.r}} \
2122 "Build property 3 (.o)" \
2123 "-m elf_x86_64 -r" \
2125 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2126 {property-x86-1.s property-stk.s} \
2127 {{readelf -n property-3a.r}} \
2131 "Build property 3 (.so)" \
2132 "-m elf_x86_64 -shared" \
2134 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2135 {property-x86-1.s property-stk.s} \
2136 {{readelf -n property-3.r}} \
2140 "Build property 4" \
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}} \
2149 "Build property 4 (.o)" \
2150 "-m elf_x86_64 -r" \
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}} \
2158 "Build property 4 (.so)" \
2159 "-m elf_x86_64 -shared" \
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}} \
2167 "Build property 4 (-z stack-size=0)" \
2168 "-m elf_x86_64 -z stack-size=0" \
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}} \
2176 "Build property 5" \
2177 "-m elf_x86_64 -z stack-size=0x900000" \
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}} \
2185 "Build property 5 (.o)" \
2186 "-m elf_x86_64 -r -z stack-size=0x900000" \
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}} \
2194 "Build property 5 (.so)" \
2195 "-m elf_x86_64 -shared -z stack-size=0x900000" \
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}} \
2203 "Build pr21626.so" \
2204 "-shared -melf_x86_64" \
2206 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2207 {property-x86-3.s} \
2213 "-melf_x86_64 tmpdir/pr21626.so" \
2215 "--64 -mx86-used-note=yes" \
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"
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"
2260 set ASFLAGS "$saved_ASFLAGS"