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