]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-aarch64/aarch64-elf.exp
Various fixes for capability IFUNCs
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-aarch64 / aarch64-elf.exp
CommitLineData
a06ea964 1# Expect script for various AARCH64 ELF tests.
b3adc24a 2# Copyright (C) 2009-2020 Free Software Foundation, Inc.
a06ea964
NC
3#
4# This file is part of the GNU Binutils.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19# MA 02110-1301, USA.
20
21# Exclude non-aarch64-ELF targets.
22if { ![is_elf_format] || ![istarget "aarch64*-*-*"] } {
23 return
24}
25
26# List contains test-items with 3 items followed by 2 lists:
897aea50
MR
27# 0:name 1:ld early options 2:ld late options 3:assembler options
28# 4:filenames of assembler files 5: action and options. 6: name of output file
a06ea964
NC
29
30# Actions:
31# objdump: Apply objdump options on result. Compare with regex (last arg).
32# nm: Apply nm options on result. Compare with regex (last arg).
33# readelf: Apply readelf options on result. Compare with regex (last arg).
34
35set aarch64elftests {
68fcca92
JW
36 {"Erratum 835769 dump test"
37 "--fix-cortex-a53-835769" "" "" {erratum835769.s}
38 {{objdump -dr erratum835769.d}}
39 "erratum835769"}
3c3358ca
AM
40}
41set tmp {
68fcca92
JW
42 {"Erratum 835769 dump test -shared"
43 "--fix-cortex-a53-835769 -shared" "" "" {erratum835769.s}
44 {{objdump -dr erratum835769.d}}
45 "erratum835769"}
a06ea964 46}
3c3358ca 47if [check_shared_lib_support] { append aarch64elftests $tmp }
a06ea964 48
696ddf4b 49proc aarch64_choose_ilp32_emul {} {
78da3bc1
AM
50 if [istarget *linux*] then {
51 if [istarget aarch64_be-*] {
52 return "aarch64linux32b"
53 }
54 return "aarch64linux32"
55 }
56 if [istarget aarch64_be-*] {
696ddf4b 57 return "aarch64elf32b"
696ddf4b 58 }
78da3bc1 59 return "aarch64elf32"
696ddf4b
JW
60}
61
971f1d27
JW
62proc aarch64_choose_lp64_emul {} {
63 if [istarget *linux*] then {
64 if [istarget aarch64_be-*] {
65 return "aarch64linuxb"
66 }
67 return "aarch64linux"
68 }
69 if [istarget aarch64_be-*] {
70 return "aarch64elfb"
71 }
72 return "aarch64elf"
73}
74
75proc run_dump_test_lp64 { testname } {
76 run_dump_test $testname \
77 [list [list as "-mabi=lp64"] \
78 [list ld [concat "-m " [aarch64_choose_lp64_emul]]]]
79}
80
808c324b
MM
81# Return the hexadecimal representation of the value we need to add to $base in
82# order to return $result plus 1. Both $base and $result are assumed to be
83# hexadecimal numbers without the leading 0x prefix.
84#
85# This procedure is especially useful for checking the addend of a RELATIVE
86# relocation against a function in a testcase using the `#check:` directive.
87# Dumping `objdump -DR -j .got -j .text` will give us the address we're trying
88# to reach and base stored in the relocation fragment before reaching the
89# addend we're using for this relocation.
90proc aarch64_required_func_addend { base result } {
91 return [format %x [expr "0x$result + 1 - 0x$base"]];
92}
93
9a68ca09
MM
94# Return the hexadecimal addition of the two given values. Values should be
95# provided in hexadecimal without the leading 0x prefix.
96#
97# Used in a testsuite to check that the combination of some ADRP/ADD constants
98# do indeed point at a variable later on in the dump.
99proc aarch64_page_plus_offset { page offset } {
100 return [format %x [expr "0x$page + 0x$offset"] ];
101}
20b65d42
MM
102proc aarch64_page_plus_decimal_offset { page offset } {
103 return [format %x [expr "0x$page + $offset"] ];
104}
9a68ca09 105
604a5d22
MM
106# Return the 8-hexdigit truncation of an address.
107proc aarch64_8digit_addr { addr { plusLSB 0 } } {
108 if { $plusLSB } {
36b60023 109 return [format %08x [expr "0x$addr + 1"]];
604a5d22 110 }
20b65d42 111 return [format %08x "0x$addr"];
604a5d22
MM
112}
113
971f1d27
JW
114set eh-frame-merge-lp64 [list [list "EH Frame merge" \
115 [concat "-m " [aarch64_choose_lp64_emul] \
116 " -Ttext 0x8000"] \
117 "" "-mabi=lp64" {eh-frame-bar.s eh-frame-foo.s} \
118 {{objdump --dwarf=frames eh-frame.d}} \
119 "eh-frame"]]
120
a06ea964 121run_ld_link_tests $aarch64elftests
971f1d27
JW
122run_ld_link_tests eh-frame-merge-lp64
123
4106101c 124run_dump_test "erratum843419"
9fca35fc 125run_dump_test "erratum843419_tls_ie"
739b5c9c
TC
126run_dump_test "erratum843419-adr"
127run_dump_test "erratum843419-adrp"
128run_dump_test "erratum843419-far-adr"
129run_dump_test "erratum843419-far-full"
130run_dump_test "erratum843419-full"
131run_dump_test "erratum843419-no-args"
0db131fb 132run_dump_test "erratum835769-843419"
a06ea964
NC
133
134# Relocation Tests
971f1d27 135run_dump_test_lp64 "weak-undefined"
e30d1fa1
SN
136run_dump_test "emit-relocs-22"
137run_dump_test "emit-relocs-23"
7018c030 138run_dump_test "emit-relocs-28"
40fbed84
JW
139run_dump_test "emit-relocs-86"
140run_dump_test "emit-relocs-86-overflow"
6ffe9a1b
JW
141run_dump_test "emit-relocs-87"
142run_dump_test "emit-relocs-88"
143run_dump_test "emit-relocs-88-overflow"
144run_dump_test "emit-relocs-89"
145run_dump_test "emit-relocs-90"
146run_dump_test "emit-relocs-90-overflow"
753999c1 147run_dump_test "emit-relocs-92"
e04ef022
RL
148
149run_dump_test "emit-relocs-112"
150run_dump_test "emit-relocs-112-overflow"
151run_dump_test "emit-relocs-113"
152run_dump_test "emit-relocs-114"
153run_dump_test "emit-relocs-114-overflow"
154run_dump_test "emit-relocs-115"
155run_dump_test "emit-relocs-116"
156run_dump_test "emit-relocs-116-overflow"
157run_dump_test "emit-relocs-117"
158run_dump_test "emit-relocs-118"
159run_dump_test "emit-relocs-118-overflow"
160run_dump_test "emit-relocs-119"
161
162run_dump_test "emit-relocs-257"
163run_dump_test "emit-relocs-257-be"
a06ea964
NC
164# 258 is tested in 257
165# 259 is tested in 257
79e74192
RL
166run_dump_test_lp64 "emit-relocs-258-dyn-bad"
167run_dump_test_lp64 "emit-relocs-259-dyn-bad"
971f1d27
JW
168run_dump_test_lp64 "emit-relocs-260"
169run_dump_test_lp64 "emit-relocs-260-be"
a06ea964 170# 261 is tested by 260
971f1d27
JW
171run_dump_test_lp64 "emit-relocs-262"
172run_dump_test_lp64 "emit-relocs-263"
173run_dump_test_lp64 "emit-relocs-264"
174run_dump_test_lp64 "emit-relocs-264-bad"
175run_dump_test_lp64 "emit-relocs-265"
176run_dump_test_lp64 "emit-relocs-266"
177run_dump_test_lp64 "emit-relocs-266-bad"
178run_dump_test_lp64 "emit-relocs-267"
179run_dump_test_lp64 "emit-relocs-268"
180run_dump_test_lp64 "emit-relocs-268-bad"
181run_dump_test_lp64 "emit-relocs-269"
182run_dump_test_lp64 "emit-relocs-269-bad"
183run_dump_test_lp64 "emit-relocs-270"
184run_dump_test_lp64 "emit-relocs-270-bad"
185run_dump_test_lp64 "emit-relocs-270-overflow"
186run_dump_test_lp64 "emit-relocs-271"
187run_dump_test_lp64 "emit-relocs-271-overflow"
188run_dump_test_lp64 "emit-relocs-272"
189run_dump_test_lp64 "emit-relocs-272-overflow"
190run_dump_test_lp64 "emit-relocs-273"
191run_dump_test_lp64 "emit-relocs-274"
192run_dump_test_lp64 "emit-relocs-275"
193run_dump_test_lp64 "emit-relocs-276"
194run_dump_test_lp64 "emit-relocs-277"
195run_dump_test_lp64 "emit-relocs-278"
196run_dump_test_lp64 "emit-relocs-279"
197run_dump_test_lp64 "emit-relocs-279-bad"
198run_dump_test_lp64 "emit-relocs-280"
a06ea964 199# 281 is unused
971f1d27
JW
200run_dump_test_lp64 "emit-relocs-282"
201run_dump_test_lp64 "emit-relocs-283"
202run_dump_test_lp64 "emit-relocs-284"
203run_dump_test_lp64 "emit-relocs-285"
204run_dump_test_lp64 "emit-relocs-286"
205run_dump_test_lp64 "emit-relocs-286-bad"
1daf502a
RL
206run_dump_test_lp64 "emit-relocs-287"
207run_dump_test_lp64 "emit-relocs-287-overflow"
208run_dump_test_lp64 "emit-relocs-288"
209run_dump_test_lp64 "emit-relocs-289"
210run_dump_test_lp64 "emit-relocs-289-overflow"
211run_dump_test_lp64 "emit-relocs-290"
212run_dump_test_lp64 "emit-relocs-291"
213run_dump_test_lp64 "emit-relocs-291-overflow"
214run_dump_test_lp64 "emit-relocs-292"
215run_dump_test_lp64 "emit-relocs-293"
216# 294-298 are not done yet
971f1d27 217run_dump_test_lp64 "emit-relocs-299"
dc8008f5 218# 300 is not done yet
971f1d27
JW
219run_dump_test_lp64 "emit-relocs-301"
220run_dump_test_lp64 "emit-relocs-301-be"
221run_dump_test_lp64 "emit-relocs-302"
222run_dump_test_lp64 "emit-relocs-302-be"
74a1bfe1 223# 303-308 are not done yet
971f1d27
JW
224run_dump_test_lp64 "emit-relocs-309-up"
225run_dump_test_lp64 "emit-relocs-309-low"
226run_dump_test_lp64 "emit-relocs-309-up-bad"
227run_dump_test_lp64 "emit-relocs-309-low-bad"
228run_dump_test_lp64 "emit-relocs-310"
229run_dump_test_lp64 "emit-relocs-310-be"
230run_dump_test_lp64 "emit-relocs-311"
231run_dump_test_lp64 "emit-relocs-312"
232run_dump_test_lp64 "emit-relocs-313"
233run_dump_test_lp64 "emit-relocs-515"
234run_dump_test_lp64 "emit-relocs-515-be"
235run_dump_test_lp64 "emit-relocs-516"
236run_dump_test_lp64 "emit-relocs-516-be"
237run_dump_test_lp64 "emit-relocs-523"
238run_dump_test_lp64 "emit-relocs-524"
239run_dump_test_lp64 "emit-relocs-525"
240run_dump_test_lp64 "emit-relocs-526"
241run_dump_test_lp64 "emit-relocs-526-overflow"
242run_dump_test_lp64 "emit-relocs-527"
243run_dump_test_lp64 "emit-relocs-528"
244run_dump_test_lp64 "emit-relocs-528-overflow"
245run_dump_test_lp64 "emit-relocs-529"
246run_dump_test_lp64 "emit-relocs-529-overflow"
247run_dump_test_lp64 "emit-relocs-530"
248run_dump_test_lp64 "emit-relocs-531"
249run_dump_test_lp64 "emit-relocs-531-overflow"
250run_dump_test_lp64 "emit-relocs-532"
251run_dump_test_lp64 "emit-relocs-533"
252run_dump_test_lp64 "emit-relocs-533-overflow"
253run_dump_test_lp64 "emit-relocs-534"
254run_dump_test_lp64 "emit-relocs-535"
255run_dump_test_lp64 "emit-relocs-535-overflow"
256run_dump_test_lp64 "emit-relocs-536"
257run_dump_test_lp64 "emit-relocs-537"
258run_dump_test_lp64 "emit-relocs-537-overflow"
259run_dump_test_lp64 "emit-relocs-538"
e04ef022
RL
260run_dump_test_lp64 "emit-relocs-552"
261run_dump_test_lp64 "emit-relocs-552-overflow"
262run_dump_test_lp64 "emit-relocs-553"
263run_dump_test_lp64 "emit-relocs-554"
264run_dump_test_lp64 "emit-relocs-554-overflow"
265run_dump_test_lp64 "emit-relocs-555"
266run_dump_test_lp64 "emit-relocs-556"
267run_dump_test_lp64 "emit-relocs-556-overflow"
268run_dump_test_lp64 "emit-relocs-557"
269run_dump_test_lp64 "emit-relocs-558"
270run_dump_test_lp64 "emit-relocs-558-overflow"
271run_dump_test_lp64 "emit-relocs-559"
7e057737 272run_dump_test_lp64 "emit-relocs-560"
a1bdea65 273run_dump_test_lp64 "emit-relocs-morello-1"
a0b64c99
SP
274run_dump_test_lp64 "emit-relocs-morello"
275run_dump_test_lp64 "emit-relocs-morello-a64c"
276run_dump_test_lp64 "emit-relocs-morello-2"
277run_dump_test_lp64 "emit-relocs-morello-2-a64c"
278run_dump_test_lp64 "emit-relocs-morello-3"
279run_dump_test_lp64 "emit-relocs-morello-3-a64c"
dbd880c7
MM
280run_dump_test_lp64 "emit-relocs-morello-4"
281run_dump_test_lp64 "emit-relocs-morello-5"
c50aec72
MM
282run_dump_test_lp64 "emit-relocs-morello-6"
283run_dump_test_lp64 "emit-relocs-morello-6b"
5fa80905 284run_dump_test_lp64 "emit-relocs-morello-7"
e10c835d 285run_dump_test_lp64 "emit-relocs-morello-8"
7470bce3 286run_dump_test_lp64 "emit-relocs-morello-9"
d465be7b 287run_dump_test_lp64 "emit-relocs-morello-10"
808c324b 288run_dump_test_lp64 "emit-relocs-morello-hidden"
d6cf562a
MM
289run_dump_test_lp64 "emit-morello-reloc-markers-1"
290run_dump_test_lp64 "emit-morello-reloc-markers-2"
291run_dump_test_lp64 "emit-morello-reloc-markers-3"
5fa80905
AC
292run_dump_test_lp64 "morello-sizeless-local-syms"
293run_dump_test_lp64 "morello-sizeless-global-syms"
294run_dump_test_lp64 "morello-sizeless-got-syms"
f8180c20 295run_dump_test_lp64 "morello-disallow-merged-binaries"
dd0ed54c 296run_dump_test_lp64 "c64-ehdr-sized-reloc"
a06ea964 297
d9f4f6fc
MM
298# Test for morello dynamic relocs can not be written in the usual manner since
299# we need to specify different `ld` command lines for different objects.
a7442448
MM
300if { [check_shared_lib_support]
301 && [ld_assemble_flags $as -march=morello+c64 $srcdir/$subdir/morello-dynamic-relocs-lib.s tmpdir/morello-dynamic-relocs-lib.o]
d9f4f6fc 302 && [ld_link $ld tmpdir/morello-dynamic-relocs.so "--shared tmpdir/morello-dynamic-relocs-lib.o"] } {
8f5baae3 303 run_dump_test_lp64 "morello-dynamic-relocs"
d9f4f6fc
MM
304 run_dump_test_lp64 "morello-dynamic-link-rela-dyn"
305 run_dump_test_lp64 "morello-dynamic-link-rela-dyn2"
306 run_dump_test_lp64 "morello-dynamic-local-got"
9a68ca09
MM
307 run_dump_test_lp64 "morello-funcptr-in-code"
308 run_dump_test_lp64 "morello-funcptr-through-data"
309 run_dump_test_lp64 "morello-funcptr-through-data-pie"
310 run_dump_test_lp64 "morello-funcptr-code-and-data"
311 run_dump_test_lp64 "morello-dataptr-in-code"
312 run_dump_test_lp64 "morello-dataptr-through-data"
313 run_dump_test_lp64 "morello-dataptr-through-data-pie"
314 run_dump_test_lp64 "morello-dataptr-code-and-data"
36b60023
MM
315 run_dump_test_lp64 "morello-ifunc-a"
316 run_dump_test_lp64 "morello-ifunc1-a"
317}
318run_dump_test_lp64 "morello-ifunc"
319run_dump_test_lp64 "morello-ifunc-b"
320run_dump_test_lp64 "morello-ifunc1"
321run_dump_test_lp64 "morello-ifunc1-b"
322run_dump_test_lp64 "morello-ifunc1-c"
323run_dump_test_lp64 "morello-ifunc2"
324run_dump_test_lp64 "morello-ifunc2-b"
325run_dump_test_lp64 "morello-ifunc3"
326run_dump_test_lp64 "morello-ifunc4"
327run_dump_test_lp64 "morello-ifunc4a"
328
329if { [check_shared_lib_support]
330 && [ld_assemble_flags $as -march=morello+c64 $srcdir/$subdir/morello-ifunc-shared.s tmpdir/morello-ifunc-shared.o]
331 && [ld_link $ld tmpdir/morello-ifunc-shared.so "--shared tmpdir/morello-ifunc-shared.o"] } {
332 run_dump_test_lp64 "morello-ifunc-dynlink"
333 run_dump_test_lp64 "morello-ifunc-dynlink-pie"
d9f4f6fc
MM
334}
335
a7442448
MM
336if { [check_shared_lib_support]
337 && [ld_assemble_flags $as -march=morello+c64 $srcdir/$subdir/morello-weakdefinitions.s tmpdir/morello-weakdefinitions.o]
c0a10a86
MM
338 && [ld_link $ld tmpdir/morello-weakdefinitions.so "--shared tmpdir/morello-weakdefinitions.o"] } {
339 run_dump_test_lp64 "morello-undefweak-relocs-PDE"
340}
341run_dump_test_lp64 "morello-undefweak-relocs-no-dyn-linker"
342run_dump_test_lp64 "morello-undefweak-relocs-PIE"
343run_dump_test_lp64 "morello-undefweak-relocs-static"
344run_dump_test_lp64 "morello-undefweak-relocs-static-relocs"
345
a7442448
MM
346if { [check_shared_lib_support]
347 && [ld_assemble_flags $as -march=morello+c64 $srcdir/$subdir/tls-shared.s tmpdir/tls-shared.o]
348 && [ld_link $ld tmpdir/tls-shared.so "-shared tmpdir/tls-shared.o"] } {
349 run_dump_test_lp64 "morello-tls-pde"
350 run_dump_test_lp64 "illegal-tlsle-pde"
351 run_dump_test_lp64 "morello-tlsie-overflow"
352}
353
d9f4f6fc
MM
354run_dump_test_lp64 "morello-static-got"
355run_dump_test_lp64 "morello-dynamic-got"
b2cb8a19 356run_dump_test_lp64 "morello-dt-init-fini"
40bbb79e 357run_dump_test_lp64 "morello-capinit"
50e192f0
SP
358run_dump_test_lp64 "morello-stubs"
359run_dump_test_lp64 "morello-stubs-static"
8504495a
AC
360run_dump_test_lp64 "morello-stubs-pcc-bounds"
361run_dump_test_lp64 "morello-stubs-sec-bounds"
7ff36d1a 362run_dump_test_lp64 "morello-sec-round"
bc64cc90
MM
363run_dump_test_lp64 "morello-sec-round-adjust"
364run_dump_test_lp64 "morello-sec-always-align"
365run_dump_test_lp64 "morello-sec-round-pcc-needed"
366run_dump_test_lp64 "morello-sec-round-data-only"
367run_dump_test_lp64 "morello-sec-round-include-relro"
368run_dump_test_lp64 "morello-pcc-bounds-include-readonly"
ea41358b 369run_dump_test_lp64 "morello-sec-round-choose-linker-syms"
e4f0a01c 370run_dump_test_lp64 "morello-entry-point"
47b91198 371run_dump_test_lp64 "morello-sec-start_stop-round"
4ca9b406
SP
372run_dump_test_lp64 "morello-tlsdesc"
373run_dump_test_lp64 "morello-tlsdesc-static"
374run_dump_test_lp64 "morello-tlsdesc-staticpie"
a7442448
MM
375run_dump_test_lp64 "morello-tlsdesc-seen-ie"
376
377run_dump_test_lp64 "morello-tlsle"
378run_dump_test_lp64 "morello-tlsle-pie"
379run_dump_test_lp64 "morello-tlsie"
380run_dump_test_lp64 "morello-tlsie-pie"
381run_dump_test_lp64 "morello-tlsie-shared"
382
383run_dump_test_lp64 "morello-size-relocs"
384run_dump_test_lp64 "morello-size-relocs-pie"
385run_dump_test_lp64 "morello-size-relocs-shared"
386
387run_dump_test_lp64 "morello-illegal-size-relocs"
388run_dump_test_lp64 "morello-illegal-size-relocs-pie"
389run_dump_test_lp64 "morello-illegal-size-relocs-shared"
390
391run_dump_test_lp64 "morello-illegal-tls"
392run_dump_test_lp64 "morello-illegal-tls-pie"
393run_dump_test_lp64 "morello-illegal-tls-shared"
40bbb79e 394
d9f4f6fc
MM
395run_dump_test "no-morello-syms-static"
396
027e9c75
NC
397run_dump_test "reloc-overflow-bad"
398
2e0488d3 399# test addend correctness when --emit-relocs specified for non-relocatable obj.
971f1d27 400run_dump_test_lp64 "emit-relocs-local-addend"
2e0488d3 401# test addend correctness when -r specified.
971f1d27 402run_dump_test_lp64 "local-addend-r"
a06ea964 403
dcbd20eb 404# test error handling on pcrel relocation for shared libraries.
971f1d27 405run_dump_test_lp64 "pcrel_pic_undefined"
d68f1976 406run_dump_test_lp64 "pcrel_pic_defined"
dcbd20eb 407
a06ea964
NC
408run_dump_test "limit-b"
409run_dump_test "limit-bl"
a06ea964 410run_dump_test "farcall-back"
f678ded7
JW
411run_dump_test "farcall-b-defsym"
412run_dump_test "farcall-bl-defsym"
07f9ddfe
JW
413run_dump_test "farcall-b-gsym"
414run_dump_test "farcall-b-plt"
415run_dump_test "farcall-bl-plt"
a06ea964
NC
416run_dump_test "farcall-bl"
417run_dump_test "farcall-b"
418run_dump_test "farcall-b-none-function"
419run_dump_test "farcall-bl-none-function"
2f340668
JW
420run_dump_test "farcall-b-section"
421run_dump_test "farcall-bl-section"
cff69cf4 422run_dump_test "farcall-group"
a06ea964
NC
423
424run_dump_test "tls-relax-all"
2d0ca824 425run_dump_test "tls-relax-all-ilp32"
a06ea964 426run_dump_test "tls-relax-gd-le"
2d0ca824 427run_dump_test "tls-relax-gd-le-ilp32"
a06ea964 428run_dump_test "tls-relax-gdesc-le"
ce12121b 429run_dump_test "tls-relax-gdesc-le-now"
2d0ca824 430run_dump_test "tls-relax-gdesc-le-ilp32"
971f1d27
JW
431run_dump_test_lp64 "tls-relax-large-gd-le"
432run_dump_test_lp64 "tls-relax-large-gd-le-be"
a06ea964 433run_dump_test "tls-relax-ie-le"
2d0ca824 434run_dump_test "tls-relax-ie-le-ilp32"
259364ad 435run_dump_test "tls-relax-ld-le-small"
c1fc2d7e 436run_dump_test "tls-relax-ld-le-small-ilp32"
259364ad 437run_dump_test "tls-relax-ld-le-tiny"
c1fc2d7e 438run_dump_test "tls-relax-ld-le-tiny-ilp32"
a06ea964 439run_dump_test "tls-desc-ie"
2d0ca824 440run_dump_test "tls-desc-ie-ilp32"
a06ea964 441run_dump_test "tls-relax-gdesc-le-2"
2d0ca824 442run_dump_test "tls-relax-gdesc-le-2-ilp32"
a06ea964 443run_dump_test "tls-relax-ie-le-2"
2d0ca824 444run_dump_test "tls-relax-ie-le-2-ilp32"
a06ea964 445run_dump_test "tls-relax-ie-le-3"
2d0ca824 446run_dump_test "tls-relax-ie-le-3-ilp32"
b480a481 447run_dump_test "tls-tiny-gd"
b480a481 448run_dump_test "tls-tiny-gd-le"
2d0ca824 449run_dump_test "tls-tiny-gd-le-ilp32"
60d1b0d6 450run_dump_test "tls-tiny-desc"
60d1b0d6 451run_dump_test "tls-tiny-desc-le"
2d0ca824 452run_dump_test "tls-tiny-desc-le-ilp32"
b1089987 453run_dump_test "tls-tiny-ie"
971f1d27
JW
454run_dump_test_lp64 "tls-large-ie"
455run_dump_test_lp64 "tls-large-ie-be"
456run_dump_test_lp64 "tls-large-desc"
457run_dump_test_lp64 "tls-large-desc-be"
77a69ff8 458run_dump_test "tls-tiny-ld"
f69e4920 459run_dump_test "tls-small-ld"
971f1d27 460run_dump_test_lp64 "tlsle"
bb3f9ed8 461run_dump_test "tlsle-symbol-offset"
cb8af559
NC
462run_dump_test "gc-got-relocs"
463run_dump_test "gc-tls-relocs"
971f1d27
JW
464run_dump_test_lp64 "gc-plt-relocs"
465run_dump_test_lp64 "gc-relocs-257-dyn"
466run_dump_test_lp64 "gc-relocs-257"
18f822a0 467run_dump_test "implicit_got_section_1"
bab91cce 468run_dump_test "pr17415"
971f1d27 469run_dump_test_lp64 "tprel_g2_overflow"
36e6c140 470run_dump_test "tprel_add_lo12_overflow"
32f573bc 471run_dump_test "protected-data"
279b2f94 472run_dump_test_lp64 "pr22764"
0c1ded8d 473run_dump_test_lp64 "pr20402"
1419bbe5 474
8a4f8507
MM
475if {[check_shared_lib_support]
476 && [ld_assemble $as $srcdir/$subdir/tls-sharedlib.s tmpdir/tls-sharedlib.o]
477 && [ld_link $ld tmpdir/tls-sharedlib.so "-shared tmpdir/tls-sharedlib.o"] } {
478 run_dump_test "tls-relax-gd-ie"
479 run_dump_test_lp64 "tls-relax-large-gd-ie"
480 run_dump_test_lp64 "tls-relax-large-gd-ie-be"
481 run_dump_test_lp64 "tls-relax-large-desc-ie"
482 run_dump_test_lp64 "tls-relax-large-desc-ie-be"
483 run_dump_test_lp64 "tls-relax-large-desc-le"
484 run_dump_test_lp64 "tls-relax-large-desc-le-be"
485 run_dump_test "tls-relax-gdesc-ie"
486 run_dump_test "tls-relax-gdesc-ie-2"
487 run_dump_test "tls-tiny-gd-ie"
488 run_dump_test "tls-tiny-desc-ie"
489}
490if {[check_shared_lib_support]
491 && [ld_assemble_flags $as -mabi=ilp32 $srcdir/$subdir/tls-sharedlib.s tmpdir/tls-sharedlib.o]
492 && [ld_link $ld tmpdir/tls-sharedlib-ilp32.so "-shared tmpdir/tls-sharedlib.o -m [aarch64_choose_ilp32_emul]"] } {
493 run_dump_test "tls-relax-gd-ie-ilp32"
494 run_dump_test "tls-tiny-gd-ie-ilp32"
495 run_dump_test "tls-tiny-desc-ie-ilp32"
496}
497run_dump_test "tls-relax-gd-ie-2"
498run_dump_test "tls-relax-ie-le-4"
499
1419bbe5
WN
500# ifunc tests
501run_dump_test "ifunc-1"
502run_dump_test "ifunc-1-local"
503run_dump_test "ifunc-2"
504run_dump_test "ifunc-2-local"
505run_dump_test "ifunc-3a"
506run_dump_test "ifunc-3b"
507run_dump_test "ifunc-4"
508run_dump_test "ifunc-4a"
509run_dump_test "ifunc-5a"
510run_dump_test "ifunc-5b"
511run_dump_test "ifunc-5a-local"
512run_dump_test "ifunc-5b-local"
513run_dump_test "ifunc-5r-local"
514run_dump_test "ifunc-6a"
515run_dump_test "ifunc-6b"
516run_dump_test "ifunc-7a"
517run_dump_test "ifunc-7b"
518run_dump_test "ifunc-7c"
519run_dump_test "ifunc-8"
971f1d27
JW
520run_dump_test_lp64 "ifunc-9"
521run_dump_test_lp64 "ifunc-10"
522run_dump_test_lp64 "ifunc-11"
523run_dump_test_lp64 "ifunc-12"
524run_dump_test_lp64 "ifunc-13"
1419bbe5
WN
525run_dump_test "ifunc-14a"
526run_dump_test "ifunc-14b"
527run_dump_test "ifunc-14c"
528run_dump_test "ifunc-14d"
529run_dump_test "ifunc-14e"
530run_dump_test "ifunc-14f"
531run_dump_test "ifunc-15"
532run_dump_test "ifunc-16"
533run_dump_test "ifunc-17a"
534run_dump_test "ifunc-17b"
971f1d27
JW
535run_dump_test_lp64 "ifunc-18a"
536run_dump_test_lp64 "ifunc-18b"
537run_dump_test_lp64 "ifunc-19a"
538run_dump_test_lp64 "ifunc-19b"
539run_dump_test_lp64 "ifunc-20"
540run_dump_test_lp64 "ifunc-21"
541run_dump_test_lp64 "ifunc-22"
c955de36 542
e19e9199
SP
543run_dump_test_lp64 "c64-ifunc-2"
544run_dump_test_lp64 "c64-ifunc-2-local"
545run_dump_test_lp64 "c64-ifunc-3a"
546run_dump_test_lp64 "c64-ifunc-3b"
547run_dump_test_lp64 "c64-ifunc-4"
548run_dump_test_lp64 "c64-ifunc-4a"
549
c955de36 550run_dump_test "relasz"
971f1d27 551run_dump_test_lp64 "relocs-1027-symbolic-func"
614b09ce 552
971f1d27 553run_dump_test_lp64 "dt_textrel"
c2170589 554
73524045
RL
555run_dump_test "plt_mapping_symbol"
556
971f1d27
JW
557run_dump_test_lp64 "rela-abs-relative"
558run_dump_test_lp64 "rela-abs-relative-be"
559run_dump_test_lp64 "rela-abs-relative-opt"
1f56df9d 560
971f1d27 561run_dump_test_lp64 "pie-bind-locally"
ac33b731 562
cd702818
SD
563run_dump_test "property-bti-pac1"
564run_dump_test "property-bti-pac2"
565run_dump_test "property-bti-pac3"
237df8fe
SD
566run_dump_test "property-bti-pac4-a"
567run_dump_test "property-bti-pac4-b"
37c18eed
SD
568run_dump_test "bti-plt-1"
569run_dump_test "bti-plt-2"
cd702818 570
823710d5
SN
571run_dump_test_lp64 "variant_pcs-r"
572run_dump_test_lp64 "variant_pcs-shared"
573run_dump_test_lp64 "variant_pcs-now"
574
614b09ce
JW
575set aarch64elflinktests {
576 {"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
027e9c75 577 {} "copy-reloc-so.so"}
614b09ce 578 {"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" ""
027e9c75 579 {copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"}
6353d82b
JW
580 {"ld-aarch64/exe with copy relocation 2" "-e0 tmpdir/copy-reloc-so.so" "" ""
581 {copy-reloc-exe-2.s} {{objdump -R copy-reloc-2.d}} "copy-reloc-2"}
582 {"ld-aarch64/exe with copy relocation elimination" "-e0 tmpdir/copy-reloc-so.so" "" ""
583 {copy-reloc-exe-eliminate.s} {{objdump -R copy-reloc-eliminate.d}} "copy-reloc-elimination"}
7f784814
JW
584 {"ld-aarch64/so with global func" "-shared" "" "" {func-in-so.s}
585 {} "func-in-so.so"}
586 {"ld-aarch64/func sym hash opt for exe"
587 "-e0 --hash-style=gnu tmpdir/func-in-so.so" "" ""
588 {func-sym-hash-opt.s} {{readelf --dyn-sym func-sym-hash-opt.d}} "hash-opt"}
37c18eed
SD
589 {"Build bti-plt-so for PLT tests" "-shared" "" "" {bti-plt-so.s}
590 {} "libbti-plt-so.so"}
614b09ce
JW
591}
592
3c3358ca
AM
593if [check_shared_lib_support] {
594 run_ld_link_tests $aarch64elflinktests
595}
37c18eed
SD
596
597run_dump_test "bti-plt-3"
598run_dump_test "bti-plt-4"
599run_dump_test "bti-plt-5"
600run_dump_test "bti-plt-6"
601run_dump_test "bti-plt-7"
1dbade74
SD
602
603run_dump_test "pac-plt-1"
604run_dump_test "pac-plt-2"
605run_dump_test "bti-pac-plt-1"
606run_dump_test "bti-pac-plt-2"
4e539114
SD
607
608run_dump_test "bti-warn"
652afeef 609run_dump_test "weak-tls"
f3ecc5c8 610run_dump_test "morello-weak-tls"
652afeef 611run_dump_test "undef-tls"