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
}} \
268 "Generate x86-64-weakundef-1.so" \
269 "-shared -melf_x86_64" \
274 "x86-64-weakundef-1.so" \
277 "Generate x86-64-weakundef-1" \
279 "tmpdir/x86-64-weakundef-1.so" \
282 {{nm
-n weakundef
-1.nd
}} \
283 "x86-64-weakundef-1" \
287 set test_name
"Mixed x86_64 and i386 input test 1"
289 if { ![ld_link $
ld tmpdir
/$test
"-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
290 if [string match
"*i386* architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
297 set test_name
"Mixed x86_64 and i386 input test 2"
299 if { ![ld_link $
ld tmpdir
/$test
"-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
300 if [string match
"*i386* architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64* output*" $link_output] {
309 run_dump_test
"pcrel8"
310 run_dump_test
"pcrel16"
311 run_dump_test
"pcrel16-2"
313 run_dump_test
"tlsgd2"
314 run_dump_test
"tlsgd3"
315 run_dump_test
"tlsgd12"
316 run_dump_test
"tlsgd13"
317 run_dump_test
"tlsie2"
318 run_dump_test
"tlsie3"
319 run_dump_test
"hidden1"
320 run_dump_test
"hidden2"
321 run_dump_test
"hidden3"
322 run_dump_test
"hidden4"
323 run_dump_test
"hidden5"
324 run_dump_test
"protected1"
325 run_dump_test
"protected2"
326 run_dump_test
"protected3"
327 run_dump_test
"protected4"
328 run_dump_test
"protected5"
329 run_dump_test
"protected6a"
330 run_dump_test
"protected6b"
331 run_dump_test
"protected7a"
332 run_dump_test
"protected7b"
333 run_dump_test
"protected8"
334 run_dump_test
"tlsle1"
335 run_dump_test
"tlspie1"
336 run_dump_test
"tlspie2a"
337 run_dump_test
"tlspie2b"
338 run_dump_test
"tlspie2c"
339 run_dump_test
"unique1"
340 run_dump_test
"nogot1"
341 run_dump_test
"nogot2"
342 run_dump_test
"discarded1"
343 run_dump_test
"pr12718"
344 run_dump_test
"pr12921"
345 run_dump_test
"pr13947"
346 run_dump_test
"pr12570a"
347 run_dump_test
"pr12570b"
348 run_dump_test
"pr14215"
349 run_dump_test
"pr14207"
350 run_dump_test
"gotplt1"
355 run_dump_test
"largecomm-1a"
356 run_dump_test
"largecomm-1b"
357 run_dump_test
"largecomm-1c"
358 run_dump_test
"largecomm-1d"
359 run_dump_test
"largecomm-1e"
360 run_dump_test
"largecomm-1f"
361 run_dump_test
"pr19539a"
362 run_dump_test
"pr19539b"
363 run_dump_test
"pr19807-1a"
364 run_dump_test
"pr19807-1b"
365 run_dump_test
"pr19807-2a"
366 run_dump_test
"pr19807-2b"
367 run_dump_test
"pr19807-2c"
368 run_dump_test
"pr19807-2d"
369 run_dump_test
"pr19807-2e"
370 run_dump_test
"pr19969"
371 run_dump_test
"pr20093-1"
372 run_dump_test
"pr20093-2"
373 run_dump_test
"property-x86-3"
374 run_dump_test
"property-x86-4a"
375 run_dump_test
"property-x86-4b"
376 run_dump_test
"property-x86-3-x32"
377 run_dump_test
"property-x86-4a-x32"
378 run_dump_test
"property-x86-4b-x32"
379 run_dump_test
"property-x86-5"
380 run_dump_test
"property-x86-5-x32"
381 run_dump_test
"property-x86-6"
382 run_dump_test
"property-x86-6-x32"
383 run_dump_test
"property-x86-ibt1a"
384 run_dump_test
"property-x86-ibt1b"
385 run_dump_test
"property-x86-ibt1a-x32"
386 run_dump_test
"property-x86-ibt1b-x32"
387 run_dump_test
"property-x86-ibt2"
388 run_dump_test
"property-x86-ibt2-x32"
389 run_dump_test
"property-x86-ibt3a"
390 run_dump_test
"property-x86-ibt3b"
391 run_dump_test
"property-x86-ibt3a-x32"
392 run_dump_test
"property-x86-ibt3b-x32"
393 run_dump_test
"property-x86-ibt4"
394 run_dump_test
"property-x86-ibt4-x32"
395 run_dump_test
"property-x86-ibt5"
396 run_dump_test
"property-x86-ibt5-x32"
397 run_dump_test
"property-x86-shstk1a"
398 run_dump_test
"property-x86-shstk1b"
399 run_dump_test
"property-x86-shstk1a-x32"
400 run_dump_test
"property-x86-shstk1b-x32"
401 run_dump_test
"property-x86-shstk2"
402 run_dump_test
"property-x86-shstk2-x32"
403 run_dump_test
"property-x86-shstk3a"
404 run_dump_test
"property-x86-shstk3b"
405 run_dump_test
"property-x86-shstk3a-x32"
406 run_dump_test
"property-x86-shstk3b-x32"
407 run_dump_test
"property-x86-shstk4"
408 run_dump_test
"property-x86-shstk4-x32"
409 run_dump_test
"property-x86-shstk5"
410 run_dump_test
"property-x86-shstk5-x32"
411 run_dump_test
"property-x86-cet1"
412 run_dump_test
"property-x86-cet1-x32"
413 run_dump_test
"property-x86-cet2a"
414 run_dump_test
"property-x86-cet2a-x32"
415 run_dump_test
"property-x86-cet2b"
416 run_dump_test
"property-x86-cet2b-x32"
417 run_dump_test
"property-x86-cet3a"
418 run_dump_test
"property-x86-cet3a-x32"
419 run_dump_test
"property-x86-cet3b"
420 run_dump_test
"property-x86-cet3b-x32"
421 run_dump_test
"property-x86-cet4a"
422 run_dump_test
"property-x86-cet4a-x32"
423 run_dump_test
"property-x86-cet4b"
424 run_dump_test
"property-x86-cet4b-x32"
425 run_dump_test
"property-x86-cet5a"
426 run_dump_test
"property-x86-cet5a-x32"
427 run_dump_test
"property-x86-cet5b"
428 run_dump_test
"property-x86-cet5b-x32"
429 run_dump_test
"property-x86-cet6"
430 run_dump_test
"property-x86-cet6-x32"
431 run_dump_test
"property-x86-lam-u48-1a"
432 run_dump_test
"property-x86-lam-u48-1b"
433 run_dump_test
"property-x86-lam-u48-2"
434 run_dump_test
"property-x86-lam-u48-3a"
435 run_dump_test
"property-x86-lam-u48-3b"
436 run_dump_test
"property-x86-lam-u48-4"
437 run_dump_test
"property-x86-lam-u48-5"
438 run_dump_test
"property-x86-lam-u57-1a"
439 run_dump_test
"property-x86-lam-u57-1b"
440 run_dump_test
"property-x86-lam-u57-2"
441 run_dump_test
"property-x86-lam-u57-3a"
442 run_dump_test
"property-x86-lam-u57-3b"
443 run_dump_test
"property-x86-lam-u57-4"
444 run_dump_test
"property-x86-lam-u57-5"
445 run_dump_test
"pr21884"
446 run_dump_test
"pr22071"
447 run_dump_test
"pr22115-1a"
448 run_dump_test
"pr22115-1a-x32"
449 run_dump_test
"pr22115-1b"
450 run_dump_test
"pr22115-1b-x32"
451 run_dump_test
"pr22115-1c"
452 run_dump_test
"pr22115-1c-x32"
453 run_dump_test
"pr22115-1d"
454 run_dump_test
"pr22115-1d-x32"
455 run_dump_test
"pr22135"
456 run_dump_test
"pr22782a"
457 run_dump_test
"pr22782b"
458 run_dump_test
"pr23189"
459 run_dump_test
"pr23194"
460 run_dump_test
"pr23324a"
461 run_dump_test
"pr23324b"
462 run_dump_test
"pr23372a"
463 run_dump_test
"pr23372a-x32"
464 run_dump_test
"pr23372b"
465 run_dump_test
"pr23372b-x32"
466 run_dump_test
"pr23372c"
467 run_dump_test
"pr23372c-x32"
468 run_dump_test
"pr23372d"
469 run_dump_test
"pr23372d-x32"
470 run_dump_test
"pr23486a"
471 run_dump_test
"pr23486a-x32"
472 run_dump_test
"pr23486b"
473 run_dump_test
"pr23486b-x32"
474 run_dump_test
"pr23486c"
475 run_dump_test
"pr23486c-x32"
476 run_dump_test
"pr23486d"
477 run_dump_test
"pr23486d-x32"
478 run_dump_test
"pr23854"
479 run_dump_test
"pr23930"
480 run_dump_test
"pr23930-x32"
481 run_dump_test
"pr24151a"
482 run_dump_test
"pr24151a-x32"
483 run_dump_test
"pr24322a"
484 run_dump_test
"pr24322a-x32"
485 run_dump_test
"pr24322b"
486 run_dump_test
"pr24322b-x32"
487 run_dump_test
"pr24458a"
488 run_dump_test
"pr24458a-x32"
489 run_dump_test
"pr24458b"
490 run_dump_test
"pr24458b-x32"
491 run_dump_test
"pr24458c"
492 run_dump_test
"pr24458c-x32"
493 run_dump_test
"pr24721"
494 run_dump_test
"pr24721-x32"
495 run_dump_test
"pr24905"
496 run_dump_test
"pr24905-x32"
497 run_dump_test
"align-branch-1"
498 run_dump_test
"pr25416-1a"
499 run_dump_test
"pr25416-2b"
500 run_dump_test
"pr25416-2a"
501 run_dump_test
"pr25416-2b"
502 run_dump_test
"pr25416-3"
503 run_dump_test
"pr25416-4"
504 run_dump_test
"pr26018"
505 run_dump_test
"pr26263"
506 run_dump_test
"pr26711-1"
507 run_dump_test
"pr26711-1-x32"
508 run_dump_test
"pr26711-2"
509 run_dump_test
"pr26711-2-x32"
510 run_dump_test
"pr26711-3"
511 run_dump_test
"pr26711-3-x32"
512 run_dump_test
"property-x86-isa1"
513 run_dump_test
"property-x86-isa1-x32"
514 run_dump_test
"property-x86-isa2"
515 run_dump_test
"property-x86-isa2-x32"
516 run_dump_test
"property-x86-isa3"
517 run_dump_test
"property-x86-isa3-x32"
518 run_dump_test
"property-x86-isa4"
519 run_dump_test
"property-x86-isa4-x32"
520 run_dump_test
"code16"
521 run_dump_test
"pr27491-1a"
522 run_dump_test
"pr27491-1b"
523 run_dump_test
"pr27491-1c"
524 run_dump_test
"pr27491-2"
525 run_dump_test
"pr27491-3"
526 run_dump_test
"pr27491-4"
527 run_dump_test
"dt-relr-1a"
528 run_dump_test
"dt-relr-1a-x32"
529 run_dump_test
"dt-relr-1b"
530 run_dump_test
"dt-relr-1b-x32"
531 run_dump_test
"pr30787"
532 run_dump_test
"pr31047"
533 run_dump_test
"pr31047-x32"
535 if { ![skip_sframe_tests
] } {
536 run_dump_test
"sframe-simple-1"
537 run_dump_test
"sframe-plt-1"
540 if ![istarget
"x86_64-*-linux*"] {
544 if ![ld_assemble $as
"--x32 $srcdir/$subdir/start.s" tmpdir/startx32.o] {
545 fail
"Build ILP32 start.o"
549 if ![ld_assemble $as
"--32 $srcdir/$subdir/start.s" tmpdir/start32.o] {
550 fail
"Build ia32 start.o"
554 if ![ld_assemble $as
"--64 $srcdir/$subdir/start.s" tmpdir/start64.o] {
555 fail
"Build LP64 start.o"
559 if ![ld_assemble $as
"--x32 $srcdir/$subdir/foo.s" tmpdir/foox32.o] {
560 fail
"Build ILP32 foo.o"
564 if ![ld_assemble $as
"--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] {
565 fail
"Build ia32 foo.o"
569 if ![ld_assemble $as
"--64 $srcdir/$subdir/foo.s" tmpdir/foo64.o] {
570 fail
"Build LP64 foo.o"
574 run_dump_test
"compressed1"
575 run_dump_test
"ilp32-1"
576 run_dump_test
"ilp32-2"
577 run_dump_test
"ilp32-3"
578 run_dump_test
"ilp32-4"
579 run_dump_test
"ilp32-5"
580 run_dump_test
"ilp32-6"
581 run_dump_test
"ilp32-7"
582 run_dump_test
"ilp32-8"
583 run_dump_test
"ilp32-9"
584 run_dump_test
"ilp32-10"
585 run_dump_test
"ilp32-11"
586 run_dump_test
"ilp32-12"
587 run_dump_test
"ia32-1"
588 run_dump_test
"ia32-2"
589 run_dump_test
"ia32-3"
590 run_dump_test
"lp64-1"
591 run_dump_test
"lp64-2"
592 run_dump_test
"lp64-3"
593 run_dump_test
"pr13082-1a"
594 run_dump_test
"pr13082-1b"
595 run_dump_test
"pr13082-2a"
596 run_dump_test
"pr13082-2b"
597 run_dump_test
"pr13082-3a"
598 run_dump_test
"pr13082-3b"
599 run_dump_test
"pr13082-3c"
600 run_dump_test
"pr13082-3d"
601 run_dump_test
"pr13082-4a"
602 run_dump_test
"pr13082-4b"
603 run_dump_test
"pr13082-5a"
604 run_dump_test
"pr13082-5b"
605 run_dump_test
"pr13082-6a"
606 run_dump_test
"pr13082-6b"
607 run_dump_test
"lea1a"
608 run_dump_test
"lea1b"
609 run_dump_test
"lea1c"
610 run_dump_test
"lea1d"
611 run_dump_test
"lea1e"
612 run_dump_test
"lea1f"
613 run_dump_test
"lea1g"
614 run_dump_test
"lea1h"
615 run_dump_test
"lea1i"
616 run_dump_test
"lea1j"
617 run_dump_test
"lea1k"
618 run_dump_test
"lea1l"
619 run_dump_test
"mov1a"
620 run_dump_test
"mov1b"
621 run_dump_test
"mov1c"
622 run_dump_test
"mov1d"
623 run_dump_test
"mov2a"
624 run_dump_test
"mov2b"
625 run_dump_test
"mov2c"
626 run_dump_test
"mov2d"
627 run_dump_test
"ljmp1"
628 run_dump_test
"ljmp2"
629 run_dump_test
"load1a"
630 run_dump_test
"load1b"
631 run_dump_test
"load1c"
632 run_dump_test
"load1d"
633 run_dump_test
"apx-load1a"
634 run_dump_test
"apx-load1b"
635 run_dump_test
"apx-load1c"
636 run_dump_test
"apx-load1d"
637 run_dump_test
"load2"
638 run_dump_test
"call1a"
639 run_dump_test
"call1b"
640 run_dump_test
"call1c"
641 run_dump_test
"call1d"
642 run_dump_test
"call1e"
643 run_dump_test
"call1f"
644 run_dump_test
"call1g"
645 run_dump_test
"call1h"
646 run_dump_test
"call1i"
647 run_dump_test
"pr17935-1"
648 run_dump_test
"pr17935-2"
649 run_dump_test
"pr18160"
650 run_dump_test
"pr18176"
651 run_dump_test
"pr18801a"
652 run_dump_test
"pr18801b"
653 run_dump_test
"ifunc-textrel-1a"
654 run_dump_test
"ifunc-textrel-1b"
655 run_dump_test
"ifunc-textrel-2a"
656 run_dump_test
"ifunc-textrel-2b"
657 run_dump_test
"pr18815"
658 run_dump_test
"pr19013"
659 run_dump_test
"pr19013-x32"
660 run_dump_test
"pr19162"
661 run_dump_test
"pr19175"
662 run_dump_test
"pr18591"
663 run_dump_test
"pr19615"
664 run_dump_test
"pr19636-1a"
665 run_dump_test
"pr19636-1b"
666 run_dump_test
"pr19636-1c"
667 run_dump_test
"pr19636-1d"
668 run_dump_test
"pr19636-1e"
669 run_dump_test
"pr19636-1f"
670 run_dump_test
"pr19636-1g"
671 run_dump_test
"pr19636-1h"
672 run_dump_test
"pr19636-1i"
673 run_dump_test
"pr19636-1j"
674 run_dump_test
"pr19636-2a"
675 run_dump_test
"pr19636-2b"
676 run_dump_test
"pr19636-2c"
677 run_dump_test
"pr19636-2d"
678 run_dump_test
"pr19636-2e"
679 run_dump_test
"pr19636-2f"
680 run_dump_test
"pr19636-2g"
681 run_dump_test
"pr19636-2h"
682 run_dump_test
"pr19636-2i"
683 run_dump_test
"pr19636-2j"
684 run_dump_test
"pr19636-2k"
685 run_dump_test
"pr19636-2l"
686 run_dump_test
"pr19636-2m"
687 run_dump_test
"pr19636-3a"
688 run_dump_test
"pr19636-3b"
689 run_dump_test
"pr19636-3c"
690 run_dump_test
"pr19645"
691 run_dump_test
"pr19609-1a"
692 run_dump_test
"pr19609-1b"
693 run_dump_test
"pr19609-1c"
694 run_dump_test
"pr19609-1d"
695 run_dump_test
"pr19609-1e"
696 run_dump_test
"pr19609-1f"
697 run_dump_test
"pr19609-1g"
698 run_dump_test
"pr19609-1h"
699 run_dump_test
"pr19609-1i"
700 run_dump_test
"pr19609-1j"
701 run_dump_test
"pr19609-1k"
702 run_dump_test
"pr19609-1l"
703 run_dump_test
"pr19609-1m"
704 run_dump_test
"pr19609-2a"
705 run_dump_test
"pr19609-2b"
706 run_dump_test
"pr19609-2c"
707 run_dump_test
"pr19609-2d"
708 run_dump_test
"pr19609-3a"
709 run_dump_test
"pr19609-3b"
710 run_dump_test
"pr19609-4a"
711 run_dump_test
"pr19609-4b"
712 run_dump_test
"pr19609-4c"
713 run_dump_test
"pr19609-4d"
714 run_dump_test
"pr19609-4e"
715 run_dump_test
"pr19609-5a"
716 run_dump_test
"pr19609-5b"
717 run_dump_test
"pr19609-5c"
718 run_dump_test
"pr19609-5d"
719 run_dump_test
"pr19609-5e"
720 run_dump_test
"pr19609-6a"
721 run_dump_test
"pr19609-6b"
722 run_dump_test
"pr19609-6c"
723 run_dump_test
"pr19609-6d"
724 run_dump_test
"pr19609-7a"
725 run_dump_test
"pr19609-7b"
726 run_dump_test
"pr19609-7c"
727 run_dump_test
"pr19609-7d"
728 run_dump_test
"pr19939a"
729 run_dump_test
"pr19939b"
730 run_dump_test
"pr19719"
731 run_dump_test
"pr20253-1a"
732 run_dump_test
"pr20253-1b"
733 run_dump_test
"pr20253-1c"
734 run_dump_test
"pr20253-1d"
735 run_dump_test
"pr20253-1e"
736 run_dump_test
"pr20253-1f"
737 run_dump_test
"pr20253-1g"
738 run_dump_test
"pr20253-1h"
739 run_dump_test
"pr20253-1i"
740 run_dump_test
"pr20253-1j"
741 run_dump_test
"pr20253-1k"
742 run_dump_test
"pr20253-1l"
743 run_dump_test
"pr20253-3"
744 run_dump_test
"pr20253-4a"
745 run_dump_test
"pr20253-4b"
746 run_dump_test
"pr20253-4c"
747 run_dump_test
"pr20253-4d"
748 run_dump_test
"pr20253-4e"
749 run_dump_test
"pr20253-4f"
750 run_dump_test
"pr20253-5a"
751 run_dump_test
"pr20253-5b"
752 run_dump_test
"tlsdesc2"
753 run_dump_test
"pr22048"
754 run_dump_test
"pr22929"
755 run_dump_test
"pr26939"
756 run_dump_test
"pr26939-x32"
757 run_dump_test
"pr27016a"
758 run_dump_test
"pr27016b"
759 run_dump_test
"report-reloc-1"
760 run_dump_test
"report-reloc-1-x32"
761 run_dump_test
"pr29820"
763 proc undefined_weak
{cflags ldflags
} {
764 set testname
"Undefined weak symbol"
765 if { ![ string match
"" $cflags$ldflags] } {
766 set testname
"$testname ($cflags $ldflags)"
769 if { [string match
"*-fPIE*" $cflags]
770 && ![string match
"*nodynamic-undefined-weak*" $ldflags] } {
771 set weak_symbol
"Weak defined"
773 set weak_symbol
"Weak undefined"
776 run_cc_link_tests
[list \
778 "Build libpr19704a.so" \
779 "-shared -Wl,-soname,libpr19704.so" \
786 "Build libpr19704b.so" \
787 "-shared -Wl,-soname,libpr19704.so" \
795 exec cp tmpdir
/libpr19704a.so tmpdir
/libpr19704.so
797 run_ld_link_exec_tests
[list \
800 "-Wl,--no-as-needed,-R,tmpdir $ldflags tmpdir/libpr19704.so" \
809 exec cp tmpdir
/libpr19704b.so tmpdir
/libpr19704.so
811 set exec_output
[run_host_cmd tmpdir
/pr19704
""]
812 if {![string match $weak_symbol $exec_output
]} {
819 # Must be native with the C compiler
820 if { [isnative
] && [check_compiler_available
] } {
821 run_cc_link_tests
[list \
823 "Helper X32 DSO from x86-64 object" "" \
824 "-m64 $NOSANITIZE_CFLAGS -fPIC -g" \
825 {simple.c
} {} "libsimple.a" \
829 set convertx32
"$objcopy -O elf32-x86-64 tmpdir/simple.o tmpdir/simple-x32.o"
830 send_log
"$convertx32\n"
831 set got
[remote_exec host
"$convertx32"]
832 if { [lindex $got
0] != 0 ||
![string match
"" [lindex $got 1]] } then {
834 fail
"Convert x86-64 object to x32"
838 run_ld_link_tests
[list \
840 "X32 DSO from x86-64 object" \
841 "-shared -melf32_x86_64 tmpdir/simple-x32.o" \
842 "$NOSANITIZE_CFLAGS" \
843 "--x32 -mx86-used-note=yes" \
844 {dummy.s
} {{readelf
{-s
--wide
} x86
-64-x32.rd
}} \
849 run_cc_link_tests
[list \
853 "-fPIC -Wa,-mx86-used-note=yes" \
859 "Build libplt-main1.a" \
861 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
863 {{readelf
{-Wr
} plt
-main1.rd
}} \
867 "Build libplt-main2.a" \
869 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
871 {{readelf
{-Wr
} plt
-main2.rd
}} \
875 "Build libplt-main3.a" \
877 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes $PLT_CFLAGS" \
879 {{readelf
{-Wr
} plt
-main3.rd
}} \
883 "Build libplt-main4.a" \
885 "-fPIC -Wa,-mrelax-relocations=yes,-mx86-used-note=yes $PLT_CFLAGS" \
887 {{readelf
{-Wr
} plt
-main4.rd
}} \
892 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
893 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
896 {{readelf
{-Wr
} plt
-main.rd
}} \
900 "Build plt-main with PIE" \
901 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
902 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
-pie
" \
903 "-fPIC -Wa,-mx86-used-note=yes" \
905 {{readelf
{-Wr
} plt
-main.rd
}} \
909 "Build copyreloc-lib.so" \
911 "-fPIC -Wa,-mx86-used-note=yes" \
912 { copyreloc
-lib.c
} \
917 "Build libcopyreloc-main.a" \
919 "-Wa,-mx86-used-note=yes" \
920 { copyreloc
-main.S
} \
922 "libcopyreloc-main.a" \
925 "Build copyreloc-main with PIE without -fPIE (1)" \
926 "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
927 "-Wa,-mx86-used-note=yes" \
929 {{readelf
{-Wr
} copyreloc
-main1.rd
}} \
933 "Build copyreloc-main with PIE without -fPIE (2)" \
934 "tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so -pie" \
935 "-Wa,-mx86-used-note=yes" \
937 {{readelf
{-Wr
} copyreloc
-main2.rd
}} \
943 "-fPIC -Wa,-mx86-used-note=yes" \
949 "Build pr17689now.so with -z now" \
950 "-shared -Wl,-z,now" \
951 "-fPIC -Wa,-mx86-used-note=yes" \
953 {{readelf
{-Wr
} pr17689now.rd
}} \
959 "-Wa,-mx86-used-note=yes" \
964 "Build pr17689 with PIE without -fPIE" \
965 "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
966 "-Wa,-mx86-used-note=yes" \
968 {{readelf
{-Wr
} pr17689.rd
}} \
972 "Build pr17689 with PIE -z now without -fPIE" \
973 "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \
974 "-Wa,-mx86-used-note=yes" \
976 {{readelf
{-Wr
} pr17689now.rd
}} \
980 "Build pr17827 with PIE without -fPIE" \
981 "-Wl,--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
982 "-Wa,-mx86-used-note=yes" \
984 {{readelf
{-Wr
} pr17827.rd
}} \
990 "-fPIC -Wa,-mx86-used-note=yes" \
998 "-Wa,-mx86-used-note=yes" \
999 { pr18900b.c pr18900c.c
} \
1005 "tmpdir/pr18900.o tmpdir/pr18900.so" \
1006 "-Wa,-mx86-used-note=yes" \
1008 {{readelf
{-Wrd
} pr18900a.rd
}} \
1013 "-Wl,--as-needed tmpdir/pr18900.o tmpdir/pr18900.so" \
1014 "-Wa,-mx86-used-note=yes" \
1016 {{readelf
{-Wrd
} pr18900b.rd
}} \
1020 "Build pr19031.so" \
1022 "-fPIC -Wa,-mx86-used-note=yes" \
1028 "Build gotpcrel1d.so" \
1030 "-Wa,-mx86-used-note=yes" \
1036 "Build gotpcrel1a.o gotpcrel1b.o gotpcrel1c.o" \
1038 "-Wa,-mrelax-relocations=yes,-mx86-used-note=yes" \
1039 { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c
} \
1043 "$NOPIE_LDFLAGS -Wl,--as-needed tmpdir/gotpcrel1a.o \
1044 tmpdir
/gotpcrel1b.o tmpdir
/gotpcrel1c.o \
1045 tmpdir
/gotpcrel1d.so
" \
1046 "-Wa,-mx86-used-note=yes" \
1048 {{objdump
{-dw
} gotpcrel1.dd
}} \
1052 "Build pr19319.so" \
1054 "-Wa,-mx86-used-note=yes" \
1061 "-pie -nostdlib -nostartfiles tmpdir/pr19319.so" \
1062 "-Wa,-mx86-used-note=yes" \
1064 {{objdump
{-dw
} pr19319.dd
}} \
1068 "Build pr24276.so" \
1069 "-shared -nostdlib -nostartfiles \
1070 -Ltmpdir $srcdir
/$subdir
/pr24276.dso
" \
1071 "-Wa,-mx86-used-note=yes" \
1073 {{warning_output pr24276.warn
}} \
1077 "Build property 1" \
1079 "-Wa,-mx86-used-note=no" \
1080 {pass.c
property-no
-copy.S
} \
1081 {{readelf
{-n
} property-1.r
}} \
1085 "Build property 1 (.o)" \
1087 "-Wa,-mx86-used-note=yes" \
1088 {pass.c
property-no
-copy.S
} \
1089 {{readelf
{-n
} property-1a.r
}} \
1093 "Build property 1 (.so)" \
1095 "-fPIC -Wa,-mx86-used-note=no" \
1096 {pass.c
property-no
-copy.S
} \
1097 {{readelf
{-n
} property-1.r
}} \
1101 "Build property 2" \
1103 "-Wa,-mx86-used-note=no" \
1104 {pass.c
property-stack.S
} \
1105 {{readelf
{-n
} property-2.r
}} \
1109 "Build property 2 (.o)" \
1111 "-Wa,-mx86-used-note=yes" \
1112 {pass.c
property-stack.S
} \
1113 {{readelf
{-n
} property-2a.r
}} \
1117 "Build property 2 (.so)" \
1119 "-fPIC -Wa,-mx86-used-note=yes" \
1120 {pass.c
property-stack.S
} \
1121 {{readelf
{-n
} property-2.r
}} \
1125 "Build property-6.so" \
1127 "-fPIC -Wa,-mx86-used-note=yes" \
1128 {property-6a.c
property-6c.S
} \
1129 {{readelf
{-n
} property-6.r
}} \
1133 "Build property-6.o" \
1135 "-Wa,-mx86-used-note=yes" \
1136 {property-6b.c
property-stack.S
} \
1137 {{readelf
{-n
} property-2a.r
}} \
1141 "Build property-6" \
1142 "-Wl,--as-needed tmpdir/property-6.o tmpdir/property-6.so" \
1143 "-Wa,-mx86-used-note=yes" \
1145 {{readelf
{-n
} property-2.r
}} \
1149 "Build property 7a (.o)" \
1151 "-Wa,-mx86-used-note=yes" \
1152 {property-unsorted
-1.S
} \
1153 {{readelf
{-n
} property-7a.r
}} \
1157 "Build property 7b (.o)" \
1159 "-Wa,-mx86-used-note=yes" \
1160 {property-unsorted
-2.S
} \
1161 {{readelf
{-n
} property-7a.r
}} \
1165 "Build pr22001-1.so" \
1167 "-fPIC -Wa,-mx86-used-note=yes" \
1173 "Build pr22001-1a" \
1174 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1175 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1177 {{error_output
"pr22001-1a.err"}} \
1181 "Build pr21997-1.so" \
1183 "-Wa,-mx86-used-note=yes" \
1184 { property-stack.S
property-no
-copy.S pr21997
-1a.S
} \
1189 "Build pr21997-1a" \
1190 "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
1191 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1193 {{error_output
"pr21997-1a.err"}} \
1197 "Build pr22064a.o" \
1199 "-Wa,-mx86-used-note=yes" \
1203 "Build pr22064.so" \
1205 "-fPIC -Wa,-mx86-used-note=yes" \
1211 "Build pr22393-3a.so" \
1212 "-shared -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1213 "-fPIC -Wa,-mx86-used-note=yes" \
1215 {{readelf
-lW pr22393
-3a.rd
} \
1216 {readelf
-lW pr22393
-3b.rd
}} \
1220 "Build pr22393-3a-now.so" \
1221 "-shared -Wl,-z,separate-code,-z,now,-z,max-page-size=0x1000" \
1222 "-fPIC -Wa,-mx86-used-note=yes" \
1224 {{readelf
-lW pr22393
-3a.rd
} \
1225 {readelf
-lW pr22393
-3b.rd
}} \
1226 "pr22393-3a-now.so" \
1230 "$NOPIE_LDFLAGS -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a.so" \
1231 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1233 {{readelf
-lW pr22393
-3a.rd
} \
1234 {readelf
-lW pr22393
-3b.rd
}} \
1238 "Build pr22393-3 (PIE)" \
1239 "-pie -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a-now.so" \
1240 "-fPIE -Wa,-mx86-used-note=yes" \
1242 {{readelf
-lW pr22393
-3a.rd
} \
1243 {readelf
-lW pr22393
-3b.rd
}} \
1247 "Build pr22393-3 (static)" \
1248 "-static -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1249 "-Wa,-mx86-used-note=yes" \
1250 {pr22393
-3a.c pr22393
-3b.c
} \
1251 {{readelf
-lW pr22393
-3a.rd
} \
1252 {readelf
-lW pr22393
-3b.rd
}} \
1253 "pr22393-3-static" \
1256 "Build pr22791-1.so" \
1258 "-fPIC -Wa,-mx86-used-note=yes" \
1265 "-pie -Wl,--no-as-needed,-z,notext tmpdir/pr22791-1.so" \
1266 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1268 {{error_output
"pr22791-1.err"}} \
1272 "Build pr22791-2a.o" \
1274 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1278 "Build pr22791-2.so" \
1279 "-shared tmpdir/pr22791-2a.o" \
1280 "-fPIC -Wa,-mx86-used-note=yes" \
1282 {{readelf
-drW pr22791
-2.rd
}} \
1287 "-pie -Wl,--no-as-needed tmpdir/pr22791-2.so" \
1288 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1290 {{readelf
-drW pr22791
-2.rd
}} \
1294 "Build pr22842.so" \
1296 "-fPIC -Wa,-mx86-used-note=yes" \
1303 "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
1304 "-Wa,-mx86-used-note=yes" \
1306 {{readelf
-rW pr22842a.rd
} \
1307 {readelf
-rW pr22842b.rd
}} \
1311 "Build libprotected-func-1.so" \
1313 "-fPIC -Wa,-mx86-used-note=yes" \
1314 { protected
-func
-1a.s
} \
1316 "libprotected-func-1.so" \
1319 "Build libprotected-func-2a.so" \
1321 "-fPIC -Wa,-mx86-used-note=yes" \
1322 { protected
-func
-2a.S
} \
1323 {{readelf
-n indirect
-extern
-access.rd
}} \
1324 "libprotected-func-2a.so" \
1327 "Build libprotected-func-2b.so" \
1328 "-shared -z indirect-extern-access" \
1329 "-fPIC -Wa,-mx86-used-note=yes" \
1330 { protected
-func
-2c.c
} \
1331 {{readelf
-n indirect
-extern
-access.rd
}} \
1332 "libprotected-func-2b.so" \
1335 "Build protected-func-2 without PIE" \
1336 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
1337 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1338 { protected
-func
-1b.c
} \
1339 {{error_output
"pr28875-func.err"}} \
1340 "protected-func-2" \
1343 "Build libprotected-func-2c.so" \
1345 "-fPIC -Wa,-mx86-used-note=yes" \
1346 { protected
-func
-2c.c
} \
1348 "libprotected-func-2c.so" \
1351 "Build protected-func-2a without PIE" \
1352 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \
1353 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1354 { protected
-func
-1b.c
} \
1355 {{error_output
"pr28875-func.err"}} \
1356 "protected-func-2a" \
1359 "Build libprotected-data-1a.so" \
1360 "-shared -z noindirect-extern-access" \
1361 "-fPIC -Wa,-mx86-used-note=yes" \
1362 { protected
-data
-1a.c
} \
1364 "libprotected-data-1a.so" \
1367 "Build libprotected-data-1b.so" \
1368 "-shared -z indirect-extern-access" \
1369 "-fPIC -Wa,-mx86-used-note=yes" \
1370 { protected
-data
-1a.c
} \
1372 "libprotected-data-1b.so" \
1375 "Build protected-data-1 without PIE" \
1376 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-1b.so" \
1377 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1378 { protected
-data
-1b.c
} \
1379 {{error_output
"pr28875-data.err"}} \
1380 "protected-data-1" \
1383 "Build libprotected-data-2a.so" \
1385 "-fPIC -Wa,-mx86-used-note=yes \
1386 -DUSE_GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS
" \
1387 { protected
-data
-2a.S
} \
1388 {{readelf
-n indirect
-extern
-access.rd
}} \
1389 "libprotected-data-2a.so" \
1392 "Build libprotected-data-2b.so" \
1393 "-shared -z indirect-extern-access" \
1394 "-fPIC -Wa,-mx86-used-note=yes" \
1395 { protected
-data
-2a.S
} \
1396 {{readelf
-n indirect
-extern
-access.rd
}} \
1397 "libprotected-data-2b.so" \
1401 if {[istarget
"x86_64-*-linux*-gnux32"]} {
1402 run_cc_link_tests
[list \
1404 "Build pr25416-5b.o (GDesc -maddress-mode=short)" \
1406 "-Wa,-mx86-used-note=yes" \
1410 "Build pr25416-5b.so (GDesc -> IE -maddress-mode=short)" \
1412 "-fPIC -Wa,-mx86-used-note=yes" \
1413 { pr25416
-5b.s pr25416
-5d.s
} \
1418 "Build pr25416-5c.o (GDesc -maddress-mode=long)" \
1420 "-Wa,-mx86-used-note=yes" \
1424 "Build pr25416-5c.so (GDesc -> IE -maddress-mode=long)" \
1426 "-fPIC -Wa,-mx86-used-note=yes" \
1427 { pr25416
-5c.s pr25416
-5d.s
} \
1432 "Build pr25416-5d.so (GDesc -maddress-mode=short)" \
1434 "-fPIC -Wa,-mx86-used-note=yes" \
1435 { pr25416
-5b.s pr25416
-5e.s
} \
1440 "Build pr25416-5d.o (IE -maddress-mode=short)" \
1442 "-Wa,-mx86-used-note=yes" \
1446 "Build pr21997-1b" \
1447 "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
1448 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1450 {{error_output
"pr21997-1b.err"}} \
1455 run_ld_link_exec_tests
[list \
1458 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1459 "-Wa,-mx86-used-note=yes" \
1466 "Run pr25416-5a (GDesc -> IE -maddress-mode=short)" \
1467 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5b.so" \
1468 "-Wa,-mx86-used-note=yes" \
1475 "Run pr25416-5b (GDesc -> LE -maddress-mode=short" \
1476 "$NOPIE_LDFLAGS tmpdir/pr25416-5b.o tmpdir/pr25416-5d.o" \
1477 "-Wa,-mx86-used-note=yes" \
1484 "Run pr25416-5c (GDesc -> IE -maddress-mode=long)" \
1485 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5c.so" \
1486 "-Wa,-mx86-used-note=yes" \
1493 "Run pr25416-5d (GDesc -> LE -maddress-mode=long)" \
1494 "$NOPIE_LDFLAGS tmpdir/pr25416-5c.o tmpdir/pr25416-5d.o" \
1495 "-Wa,-mx86-used-note=yes" \
1502 "Run pr25416-5e (GDesc -maddress-mode=short)" \
1503 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5d.so" \
1504 "-Wa,-mx86-used-note=yes" \
1511 "Run pr25416-5f (PIE GDesc -> LE -maddress-mode=short)" \
1512 "-pie -Wl,-z,notext tmpdir/pr25416-5b.o tmpdir/pr25416-5d.o" \
1513 "-Wa,-mx86-used-note=yes" \
1519 "Run pr25416-5g (PIE GDesc -> LE -maddress-mode=long)" \
1520 "-pie -Wl,-z,notext tmpdir/pr25416-5c.o tmpdir/pr25416-5d.o" \
1521 "-Wa,-mx86-used-note=yes" \
1528 run_cc_link_tests
[list \
1530 "Build pr22001-1b" \
1531 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
1532 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1534 {{error_output
"pr22001-1b.err"}} \
1538 "Build pr21997-1b" \
1539 "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
1540 "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
1542 {{error_output
"pr21997-1b.err"}} \
1546 "Build lam-u48.so" \
1547 "-shared -Wl,-z,lam-u48" \
1550 {{readelf
-n lam
-u48.rd
}} \
1554 "Build lam-u57.so" \
1555 "-shared -Wl,-z,lam-u57" \
1558 {{readelf
-n lam
-u57.rd
}} \
1564 run_ld_link_exec_tests
[list \
1567 "-Wl,--no-as-needed tmpdir/plt-main1.o tmpdir/plt-main2.o \
1568 tmpdir
/plt
-main3.o tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
1569 "-Wa,-mx86-used-note=yes" \
1575 "Run plt-main with PIE" \
1576 "-Wl,--no-as-needed -pie tmpdir/plt-main1.o tmpdir/plt-main2.o \
1577 tmpdir
/plt
-main3.o tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
1578 "-Wa,-mx86-used-note=yes" \
1585 "Run copyreloc-main with PIE without -fPIE" \
1586 "-Wl,--as-needed -pie tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so" \
1587 "-Wa,-mx86-used-note=yes" \
1590 "copyreloc-main.out" \
1593 "Run pr17689 with PIE without -fPIE" \
1594 "-Wl,--no-as-needed -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \
1595 "-Wa,-mx86-used-note=yes" \
1601 "Run pr17689 with PIE -z now without -fPIE" \
1602 "-Wl,--as-needed,-z,now -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \
1603 "-Wa,-mx86-used-note=yes" \
1610 "-Wl,--no-as-needed tmpdir/pr18900.o tmpdir/pr18900.so" \
1611 "-Wa,-mx86-used-note=yes" \
1618 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr19031.so" \
1619 "-Wa,-mx86-used-note=yes" \
1620 { pr19031b.S pr19031c.c
} \
1627 "-Wl,--no-as-needed tmpdir/gotpcrel1d.so" \
1628 "-Wa,-mx86-used-note=yes" \
1629 { gotpcrel1a.S gotpcrel1b.c gotpcrel1c.c
} \
1636 "-Wa,-mx86-used-note=yes" \
1637 {pass.c
property-no
-copy.S
} \
1638 "property-1" "pass.out" \
1641 "Run property 1 (PIE)" \
1643 "-Wa,-mx86-used-note=yes" \
1644 {pass.c
property-no
-copy.S
} \
1645 "property-1-pie" "pass.out" "-fPIE" \
1648 "Run property 1 (static)" \
1650 "-Wa,-mx86-used-note=yes" \
1651 {pass.c
property-no
-copy.S
} \
1652 "property-1-static" "pass.out" \
1657 "-Wa,-mx86-used-note=yes" \
1658 {pass.c
property-stack.S
} \
1659 "property-2" "pass.out" \
1662 "Run property 2 (PIE)" \
1664 "-Wa,-mx86-used-note=yes" \
1665 {pass.c
property-stack.S
} \
1666 "property-2-pie" "pass.out" "-fPIE" \
1669 "Run property 2 (static)" \
1671 "-Wa,-mx86-used-note=yes" \
1672 {pass.c
property-stack.S
} \
1673 "property-3-static" "pass.out" \
1676 "Run pr22001-1a (PIC 1)" \
1677 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1678 "-Wa,-mx86-used-note=yes" \
1680 "pr22001-1a-pic-1" \
1685 "Run pr22001-1a (PIC 2)" \
1686 "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1687 "-Wa,-mx86-used-note=yes" \
1689 "pr22001-1a-pic-2" \
1694 "Run pr22001-1b (PIC 1)" \
1695 "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1696 "-Wa,-mx86-used-note=yes" \
1698 "pr22001-1b-pic-1" \
1703 "Run pr22001-1b (PIC 2)" \
1704 "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
1705 "-Wa,-mx86-used-note=yes" \
1707 "pr22001-1b-pic-2" \
1712 "Run pr21997-1a (PIC 1)" \
1713 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1714 "-Wa,-mx86-used-note=yes" \
1716 "pr21997-1a-pic-1" \
1721 "Run pr21997-1a (PIC 2)" \
1722 "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1723 "-Wa,-mx86-used-note=yes" \
1725 "pr21997-1a-pic-2" \
1730 "Run pr21997-1b (PIC 1)" \
1731 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1732 "-Wa,-mx86-used-note=yes" \
1734 "pr21997-1b-pic-1" \
1739 "Run pr21997-1b (PIC 2)" \
1740 "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
1741 "-Wa,-mx86-used-note=yes" \
1743 "pr21997-1b-pic-2" \
1749 "-pie -Wl,--no-as-needed tmpdir/pr22064a.o tmpdir/pr22064.so" \
1750 "-Wa,-mx86-used-note=yes" \
1758 "$NOPIE_LDFLAGS -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a.so" \
1759 "-Wa,-mx86-used-note=yes" \
1766 "Run pr22393-3 (PIE)" \
1767 "-pie -Wl,-z,separate-code,-z,max-page-size=0x1000,--no-as-needed tmpdir/pr22393-3a-now.so" \
1768 "-Wa,-mx86-used-note=yes" \
1775 "Run pr22393-3 (static)" \
1776 "-static -Wl,-z,separate-code,-z,max-page-size=0x1000" \
1777 "-Wa,-mx86-used-note=yes" \
1778 {pr22393
-3a.c pr22393
-3b.c
} \
1779 "pr22393-3-static" \
1784 "-pie -Wl,--no-as-needed tmpdir/pr22791-2.so" \
1785 "-Wa,-mx86-used-note=yes" \
1793 "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
1794 "-Wa,-mx86-used-note=yes" \
1803 { pr23997a.s pr23997b.c pr23997c.c
} \
1808 "Run protected-func-1 with PIE" \
1809 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-1.so" \
1810 "-Wa,-mx86-used-note=yes" \
1811 { protected
-func
-1b.c
} \
1812 "protected-func-1b" \
1817 "Run protected-func-2a without PIE" \
1818 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2a.so" \
1819 "-Wa,-mx86-used-note=yes" \
1820 { protected
-func
-2b.S
} \
1821 "protected-func-2a" \
1826 "Run protected-func-2b with PIE" \
1827 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-2a.so" \
1828 "-Wa,-mx86-used-note=yes" \
1829 { protected
-func
-2b.S
} \
1830 "protected-func-2b" \
1835 "Run protected-func-2c without PIE" \
1836 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \
1837 "-Wa,-mx86-used-note=yes" \
1838 { protected
-func
-2b.S
} \
1839 "protected-func-2c" \
1844 "Run protected-func-2d with PIE" \
1845 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-2b.so" \
1846 "-Wa,-mx86-used-note=yes" \
1847 { protected
-func
-2b.S
} \
1848 "protected-func-2d" \
1853 "Run protected-func-3a without PIE" \
1854 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2a.so" \
1855 "-Wa,-mx86-used-note=yes" \
1856 { protected
-func
-3.c
} \
1857 "protected-func-3a" \
1862 "Run protected-func-3b with PIE" \
1863 "-Wl,--no-as-needed -pie tmpdir/libprotected-func-2a.so" \
1864 "-Wa,-mx86-used-note=yes" \
1865 { protected
-func
-3.c
} \
1866 "protected-func-2b" \
1871 "Run protected-data-2a without PIE" \
1872 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-2a.so" \
1873 "-Wa,-mx86-used-note=yes" \
1874 { protected
-data
-2b.S
} \
1875 "protected-data-2a" \
1880 "Run protected-data-2b with PIE" \
1881 "-Wl,--no-as-needed -pie tmpdir/libprotected-data-2a.so" \
1882 "-Wa,-mx86-used-note=yes" \
1883 { protected
-data
-2b.S
} \
1884 "protected-data-2b" \
1889 "Run protected-data-2c without PIE" \
1890 "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-2b.so" \
1891 "-Wa,-mx86-used-note=yes" \
1892 { protected
-data
-2b.S
} \
1893 "protected-data-2c" \
1898 "Run protected-data-2d with PIE" \
1899 "-Wl,--no-as-needed -pie tmpdir/libprotected-data-2b.so" \
1900 "-Wa,-mx86-used-note=yes" \
1901 { protected
-data
-2b.S
} \
1902 "protected-data-2d" \
1908 # Run
-time tests which require working ifunc attribute support.
1909 if { [check_ifunc_attribute_available
] } {
1910 run_cc_link_tests
[list \
1912 "Build libpr19784a.so" \
1913 "-shared -Wl,-Bsymbolic-functions" \
1914 "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
1915 { pr19784b.c pr19784c.c
} \
1920 "Build libpr19784b.so" \
1921 "-shared -Wl,-Bsymbolic-functions" \
1922 "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
1923 { pr19784c.c pr19784b.c
} \
1928 "Build pr19784a.o" \
1930 "-Wa,-mx86-used-note=yes" \
1935 run_ld_link_exec_tests
[list \
1938 "-Wl,--no-as-needed tmpdir/pr19784a.o tmpdir/libpr19784a.so" \
1939 "-Wa,-mx86-used-note=yes" \
1946 "-Wl,--as-needed tmpdir/pr19784a.o tmpdir/libpr19784b.so" \
1947 "-Wa,-mx86-used-note=yes" \
1955 if { [istarget
"x86_64-*-linux*"] } {
1956 set pltdump
{{objdump
{-drw
} plt
-main
-ibt.dd
}}
1957 set pltsecdump
{{readelf
{-SW
} plt
-main
-ibt
-now.rd
} {objdump
{-drw
} plt
-main
-ibt.dd
}}
1958 run_cc_link_tests
[list \
1960 "Build plt-main with -z ibtplt" \
1961 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1962 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
-Wl
,-z
,ibtplt \
1963 -Wl
,-z
,noseparate
-code
,-z
,max-page-size
=0x200000" \
1964 "-Wa,-mx86-used-note=yes" \
1970 "Build plt-main with PIE and -z ibtplt" \
1971 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1972 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
-pie \
1973 -Wl
,-z
,ibtplt
,-z
,noseparate
-code \
1974 -Wl
,-z
,max-page-size
=0x200000" \
1975 "-fPIC -Wa,-mx86-used-note=yes" \
1978 "plt-main-pie-ibt" \
1981 "Build plt-main with -z ibtplt -z now" \
1982 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1983 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
-Wl
,-z
,ibtplt \
1984 -Wl
,-z
,now
,-z
,noseparate
-code
,-z
,max-page-size
=0x200000" \
1985 "-Wa,-mx86-used-note=yes" \
1988 "plt-main-ibt-now" \
1991 "Build plt-main with PIE and -z ibtplt -z now" \
1992 "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
1993 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
-pie \
1994 -Wl
,-z
,ibtplt
,-z
,now
,-z
,noseparate
-code \
1995 -Wl
,-z
,max-page-size
=0x200000" \
1996 "-fPIC -Wa,-mx86-used-note=yes" \
1999 "plt-main-pie-ibt-now" \
2002 "Build libibtplt-lib.so with -z ibtplt" \
2003 "-shared -Wl,-z,ibtplt,-z,noseparate-code \
2004 -Wl
,-z
,max-page-size
=0x200000" \
2005 "-fPIC -Wa,-mx86-used-note=yes" \
2006 { plt
-main1.c plt
-main2.c plt
-main3.c plt
-main4.c
} \
2008 "libibtplt-lib.so" \
2011 "Build libibtplt--now-lib.so with -z ibtplt -z now" \
2012 "-shared -Wl,-z,ibtplt,-z,now,-z,noseparate-code \
2013 -Wl
,-z
,max-page-size
=0x200000" \
2014 "-fPIC -Wa,-mx86-used-note=yes" \
2015 { plt
-main1.c plt
-main2.c plt
-main3.c plt
-main4.c
} \
2017 "libibtplt-now-lib.so" \
2021 run_ld_link_exec_tests
[list \
2023 "Run plt-main with -z ibtplt" \
2024 "-Wl,--no-as-needed,-z,ibtplt tmpdir/plt-main1.o \
2025 tmpdir
/plt
-main2.o tmpdir
/plt
-main3.o \
2026 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
2027 "-Wa,-mx86-used-note=yes" \
2033 "Run plt-main with PIE and -z ibtplt" \
2034 "-Wl,--no-as-needed,-z,ibtplt -pie tmpdir/plt-main1.o \
2035 tmpdir
/plt
-main2.o tmpdir
/plt
-main3.o \
2036 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
2037 "-Wa,-mx86-used-note=yes" \
2039 "plt-main-pie-ibt" \
2044 "Run plt-main with -z ibtplt -z now" \
2045 "-Wl,--no-as-needed,-z,ibtplt,-z,now tmpdir/plt-main1.o \
2046 tmpdir
/plt
-main2.o tmpdir
/plt
-main3.o \
2047 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
2048 "-Wa,-mx86-used-note=yes" \
2050 "plt-main-ibt-now" \
2054 "Run plt-main with PIE and -z ibtplt -z now" \
2055 "-Wl,--no-as-needed,-z,ibtplt,-z,now -pie tmpdir/plt-main1.o \
2056 tmpdir
/plt
-main2.o tmpdir
/plt
-main3.o \
2057 tmpdir
/plt
-main4.o tmpdir
/libplt
-lib.so
" \
2058 "-Wa,-mx86-used-note=yes" \
2060 "plt-main-pie-ibt-now" \
2065 "Run plt-main with libibtplt-lib.so -z ibtplt" \
2066 "-Wl,--no-as-needed,-z,ibtplt tmpdir/libibtplt-lib.so \
2067 tmpdir
/libplt
-lib.so
" \
2068 "-Wa,-mx86-used-note=yes" \
2070 "plt-main-ibt-lib" \
2074 "Run plt-main with libibtplt-lib.so -z ibtplt -z now" \
2075 "-Wl,--no-as-needed,-z,ibtplt,-z,now \
2076 tmpdir
/libibtplt
-now
-lib.so tmpdir
/libplt
-lib.so
" \
2077 "-Wa,-mx86-used-note=yes" \
2079 "plt-main-ibt-now-lib" \
2084 if { [check_ifunc_attribute_available
] } {
2085 run_ld_link_exec_tests
[list \
2088 "$NOPIE_LDFLAGS -Wl,-z,ibtplt" \
2089 "-Wa,-mx86-used-note=yes" \
2090 { pr21481a.c pr21481b.S
} \
2097 "$NOPIE_LDFLAGS -Wl,-z,ibtplt,-z,now" \
2098 "-Wa,-mx86-used-note=yes" \
2099 { pr21481a.c pr21481b.S
} \
2108 undefined_weak
"$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
2109 undefined_weak
"-fPIE" ""
2110 undefined_weak
"-fPIE" "-pie"
2111 undefined_weak
"-fPIE" "-Wl,-z,nodynamic-undefined-weak"
2112 undefined_weak
"-fPIE" "-pie -Wl,-z,nodynamic-undefined-weak"
2115 if { ![istarget
"x86_64-*-linux*"]} {
2116 set ASFLAGS
"$saved_ASFLAGS"
2120 run_ld_link_tests
[list \
2122 "basic PLT generation (-z now)" \
2123 "-z now -melf_x86_64 --hash-style=sysv tmpdir/libpltlib.so \
2125 -z noseparate
-code
-z
max-page-size
=0x200000" \
2129 {{readelf
-SW plt2.rd
} {objdump
-dwr plt2.dd
}} \
2133 "Build property 3" \
2136 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2137 {property-stk.s
property-x86
-1.s
} \
2138 {{readelf
-n
property-3.r
}} \
2142 "Build property 3 (.o)" \
2143 "-m elf_x86_64 -r" \
2145 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2146 {property-x86
-1.s
property-stk.s
} \
2147 {{readelf
-n
property-3a.r
}} \
2151 "Build property 3 (.so)" \
2152 "-m elf_x86_64 -shared" \
2154 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2155 {property-x86
-1.s
property-stk.s
} \
2156 {{readelf
-n
property-3.r
}} \
2160 "Build property 4" \
2163 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2164 {property-stk.s
property-x86
-1.s
property-x86
-2.s
} \
2165 {{readelf
-n
property-4.r
}} \
2169 "Build property 4 (.o)" \
2170 "-m elf_x86_64 -r" \
2172 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2173 {property-x86
-2.s
property-x86
-1.s
property-stk.s
} \
2174 {{readelf
{-n
} property-4a.r
}} \
2178 "Build property 4 (.so)" \
2179 "-m elf_x86_64 -shared" \
2181 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2182 {property-x86
-2.s
property-x86
-1.s
property-stk.s
} \
2183 {{readelf
-n
property-4.r
}} \
2187 "Build property 4 (-z stack-size=0)" \
2188 "-m elf_x86_64 -z stack-size=0" \
2190 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2191 {property-stk.s
property-x86
-1.s
property-x86
-2.s
} \
2192 {{readelf
-n
property-4.r
}} \
2196 "Build property 5" \
2197 "-m elf_x86_64 -z stack-size=0x900000" \
2199 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2200 {property-stk.s
property-x86
-1.s
property-x86
-2.s
} \
2201 {{readelf
-n
property-5.r
}} \
2205 "Build property 5 (.o)" \
2206 "-m elf_x86_64 -r -z stack-size=0x900000" \
2208 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2209 {property-x86
-2.s
property-x86
-1.s
property-stk.s
} \
2210 {{readelf
{-n
} property-5a.r
}} \
2214 "Build property 5 (.so)" \
2215 "-m elf_x86_64 -shared -z stack-size=0x900000" \
2217 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2218 {property-x86
-2.s
property-x86
-1.s
property-stk.s
} \
2219 {{readelf
-n
property-5.r
}} \
2223 "Build pr21626.so" \
2224 "-shared -melf_x86_64" \
2226 "--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
2227 {property-x86
-3.s
} \
2233 "-melf_x86_64 tmpdir/pr21626.so" \
2235 "--64 -mx86-used-note=yes" \
2242 # Linux only tests. Disabled due to large memory requirement.
2243 if { "x$LD_CLASS" == "64bit" } then {
2244 # This test needs
64-bit linker.
2245 run_dump_test
"pr17618"
2247 run_dump_test
"pltgot-1"
2248 run_dump_test
"pltgot-2"
2249 run_dump_test
"pr20830a"
2250 run_dump_test
"pr20830b"
2251 run_dump_test
"pr20830a-now"
2252 run_dump_test
"pr20830b-now"
2253 run_dump_test
"ibt-plt-1"
2254 run_dump_test
"ibt-plt-1-x32"
2255 run_dump_test
"ibt-plt-2a"
2256 run_dump_test
"ibt-plt-2b"
2257 run_dump_test
"ibt-plt-2c"
2258 run_dump_test
"ibt-plt-2d"
2259 run_dump_test
"ibt-plt-2a-x32"
2260 run_dump_test
"ibt-plt-2b-x32"
2261 run_dump_test
"ibt-plt-2c-x32"
2262 run_dump_test
"ibt-plt-2d-x32"
2263 run_dump_test
"ibt-plt-3a"
2264 run_dump_test
"ibt-plt-3b"
2265 run_dump_test
"ibt-plt-3c"
2266 run_dump_test
"ibt-plt-3d"
2267 run_dump_test
"ibt-plt-3a-x32"
2268 run_dump_test
"ibt-plt-3b-x32"
2269 run_dump_test
"ibt-plt-3c-x32"
2270 run_dump_test
"ibt-plt-3d-x32"
2271 run_dump_test
"mark-plt-1a"
2272 run_dump_test
"mark-plt-1b"
2273 run_dump_test
"mark-plt-1c"
2274 run_dump_test
"mark-plt-1d"
2275 run_dump_test
"mark-plt-1a-x32"
2276 run_dump_test
"mark-plt-1b-x32"
2277 run_dump_test
"mark-plt-1c-x32"
2278 run_dump_test
"mark-plt-1d-x32"
2280 if { [check_compiler_available
] } {
2281 run_cc_link_tests
[list \
2283 "Build mark-plt-1.so" \
2284 "-shared -Wl,--no-as-needed,-z,mark-plt,-z,pack-relative-relocs" \
2287 {{readelf
{-W
--version
-info} mark
-plt
-1a.rd
} \
2288 {readelf
{-W
--version
-info} mark
-plt
-1b.rd
}} \
2294 set ASFLAGS
"$saved_ASFLAGS"