1 # Expect script for various AARCH64 ELF tests.
2 # Copyright (C) 2009-2016 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 # Exclude non-aarch64-ELF targets.
22 if { ![is_elf_format] || ![istarget "aarch64*-*-*"] } {
26 # List contains test-items with 3 items followed by 2 lists:
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
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).
36 {"EH Frame merge" "-Ttext 0x8000" "" "" {eh-frame-bar.s eh-frame-foo.s}
37 {{objdump --dwarf=frames eh-frame.d}} "eh-frame"}
38 {"Erratum 835769 dump test"
39 "--fix-cortex-a53-835769" "" "" {erratum835769.s}
40 {{objdump -dr erratum835769.d}}
42 {"Erratum 835769 dump test -shared"
43 "--fix-cortex-a53-835769 -shared" "" "" {erratum835769.s}
44 {{objdump -dr erratum835769.d}}
48 proc aarch64_choose_ilp32_emul {} {
49 if [istarget *linux*] then {
50 if [istarget aarch64_be-*] {
51 return "aarch64linux32b"
53 return "aarch64linux32"
55 if [istarget aarch64_be-*] {
56 return "aarch64elf32b"
61 run_ld_link_tests $aarch64elftests
62 run_dump_test "erratum843419"
65 run_dump_test "weak-undefined"
66 run_dump_test "emit-relocs-28"
67 run_dump_test "emit-relocs-86"
68 run_dump_test "emit-relocs-86-overflow"
69 run_dump_test "emit-relocs-87"
70 run_dump_test "emit-relocs-88"
71 run_dump_test "emit-relocs-88-overflow"
72 run_dump_test "emit-relocs-89"
73 run_dump_test "emit-relocs-90"
74 run_dump_test "emit-relocs-90-overflow"
75 run_dump_test "emit-relocs-92"
76 run_dump_test "emit-relocs-257"
77 run_dump_test "emit-relocs-257-be"
78 # 258 is tested in 257
79 # 259 is tested in 257
80 run_dump_test "emit-relocs-260"
81 run_dump_test "emit-relocs-260-be"
82 # 261 is tested by 260
83 run_dump_test "emit-relocs-262"
84 run_dump_test "emit-relocs-263"
85 run_dump_test "emit-relocs-264"
86 run_dump_test "emit-relocs-264-bad"
87 run_dump_test "emit-relocs-265"
88 run_dump_test "emit-relocs-266"
89 run_dump_test "emit-relocs-266-bad"
90 run_dump_test "emit-relocs-267"
91 run_dump_test "emit-relocs-268"
92 run_dump_test "emit-relocs-268-bad"
93 run_dump_test "emit-relocs-269"
94 run_dump_test "emit-relocs-269-bad"
95 run_dump_test "emit-relocs-270"
96 run_dump_test "emit-relocs-270-bad"
97 run_dump_test "emit-relocs-270-overflow"
98 run_dump_test "emit-relocs-271"
99 run_dump_test "emit-relocs-271-overflow"
100 run_dump_test "emit-relocs-272"
101 run_dump_test "emit-relocs-272-overflow"
102 run_dump_test "emit-relocs-273"
103 run_dump_test "emit-relocs-274"
104 run_dump_test "emit-relocs-275"
105 run_dump_test "emit-relocs-276"
106 run_dump_test "emit-relocs-277"
107 run_dump_test "emit-relocs-278"
108 run_dump_test "emit-relocs-279"
109 run_dump_test "emit-relocs-279-bad"
110 run_dump_test "emit-relocs-280"
112 run_dump_test "emit-relocs-282"
113 run_dump_test "emit-relocs-283"
114 run_dump_test "emit-relocs-284"
115 run_dump_test "emit-relocs-285"
116 run_dump_test "emit-relocs-286"
117 run_dump_test "emit-relocs-286-bad"
118 # 287-298 are not done yet
119 run_dump_test "emit-relocs-299"
120 # 300 is not done yet
121 run_dump_test "emit-relocs-301"
122 run_dump_test "emit-relocs-301-be"
123 run_dump_test "emit-relocs-302"
124 run_dump_test "emit-relocs-302-be"
125 # 303-308 are not done yet
126 run_dump_test "emit-relocs-309-up"
127 run_dump_test "emit-relocs-309-low"
128 run_dump_test "emit-relocs-309-up-bad"
129 run_dump_test "emit-relocs-309-low-bad"
130 run_dump_test "emit-relocs-310"
131 run_dump_test "emit-relocs-310-be"
132 run_dump_test "emit-relocs-311"
133 run_dump_test "emit-relocs-312"
134 run_dump_test "emit-relocs-313"
135 run_dump_test "emit-relocs-515"
136 run_dump_test "emit-relocs-515-be"
137 run_dump_test "emit-relocs-516"
138 run_dump_test "emit-relocs-516-be"
139 run_dump_test "emit-relocs-523"
140 run_dump_test "emit-relocs-524"
141 run_dump_test "emit-relocs-525"
142 run_dump_test "emit-relocs-526"
143 run_dump_test "emit-relocs-526-overflow"
144 run_dump_test "emit-relocs-527"
145 run_dump_test "emit-relocs-528"
146 run_dump_test "emit-relocs-528-overflow"
147 run_dump_test "emit-relocs-529"
148 run_dump_test "emit-relocs-529-overflow"
149 run_dump_test "emit-relocs-530"
150 run_dump_test "emit-relocs-531"
151 run_dump_test "emit-relocs-531-overflow"
152 run_dump_test "emit-relocs-532"
153 run_dump_test "emit-relocs-533"
154 run_dump_test "emit-relocs-533-overflow"
155 run_dump_test "emit-relocs-534"
156 run_dump_test "emit-relocs-535"
157 run_dump_test "emit-relocs-535-overflow"
158 run_dump_test "emit-relocs-536"
159 run_dump_test "emit-relocs-537"
160 run_dump_test "emit-relocs-537-overflow"
161 run_dump_test "emit-relocs-538"
163 run_dump_test "reloc-overflow-bad"
165 # test addend correctness when --emit-relocs specified for non-relocatable obj.
166 run_dump_test "emit-relocs-local-addend"
167 # test addend correctness when -r specified.
168 run_dump_test "local-addend-r"
170 # test error handling on pcrel relocation for shared libraries.
171 run_dump_test "pcrel_pic_undefined"
172 run_dump_test "pcrel_pic_defined_local"
174 run_dump_test "limit-b"
175 run_dump_test "limit-bl"
176 run_dump_test "farcall-back"
177 run_dump_test "farcall-b-defsym"
178 run_dump_test "farcall-bl-defsym"
179 run_dump_test "farcall-b-gsym"
180 run_dump_test "farcall-b-plt"
181 run_dump_test "farcall-bl-plt"
182 run_dump_test "farcall-bl"
183 run_dump_test "farcall-b"
184 run_dump_test "farcall-b-none-function"
185 run_dump_test "farcall-bl-none-function"
186 run_dump_test "farcall-b-section"
187 run_dump_test "farcall-bl-section"
189 run_dump_test "tls-relax-all"
190 run_dump_test "tls-relax-gd-le"
191 run_dump_test "tls-relax-gdesc-le"
192 run_dump_test "tls-relax-gd-ie"
193 run_dump_test "tls-relax-large-gd-ie"
194 run_dump_test "tls-relax-large-gd-ie-be"
195 run_dump_test "tls-relax-large-gd-le"
196 run_dump_test "tls-relax-large-gd-le-be"
197 run_dump_test "tls-relax-large-desc-ie"
198 run_dump_test "tls-relax-large-desc-ie-be"
199 run_dump_test "tls-relax-large-desc-le"
200 run_dump_test "tls-relax-large-desc-le-be"
201 run_dump_test "tls-relax-gdesc-ie"
202 run_dump_test "tls-relax-ie-le"
203 run_dump_test "tls-relax-ld-le-small"
204 run_dump_test "tls-relax-ld-le-tiny"
205 run_dump_test "tls-desc-ie"
206 run_dump_test "tls-relax-gdesc-ie-2"
207 run_dump_test "tls-relax-gdesc-le-2"
208 run_dump_test "tls-relax-ie-le-2"
209 run_dump_test "tls-relax-ie-le-3"
210 run_dump_test "tls-tiny-gd"
211 run_dump_test "tls-tiny-gd-ie"
212 run_dump_test "tls-tiny-gd-le"
213 run_dump_test "tls-tiny-desc"
214 run_dump_test "tls-tiny-desc-ie"
215 run_dump_test "tls-tiny-desc-le"
216 run_dump_test "tls-tiny-ie"
217 run_dump_test "tls-large-ie"
218 run_dump_test "tls-large-ie-be"
219 run_dump_test "tls-large-desc"
220 run_dump_test "tls-large-desc-be"
221 run_dump_test "tls-tiny-ld"
222 run_dump_test "tls-small-ld"
223 run_dump_test "tlsle"
224 run_dump_test "tlsle-symbol-offset"
225 run_dump_test "gc-got-relocs"
226 run_dump_test "gc-tls-relocs"
227 run_dump_test "gc-plt-relocs"
228 run_dump_test "gc-relocs-257-dyn"
229 run_dump_test "gc-relocs-257"
230 run_dump_test "implicit_got_section_1"
231 run_dump_test "pr17415"
232 run_dump_test "tprel_g2_overflow"
233 run_dump_test "tprel_add_lo12_overflow"
234 run_dump_test "protected-data"
237 run_dump_test "ifunc-1"
238 run_dump_test "ifunc-1-local"
239 run_dump_test "ifunc-2"
240 run_dump_test "ifunc-2-local"
241 run_dump_test "ifunc-3a"
242 run_dump_test "ifunc-3b"
243 run_dump_test "ifunc-4"
244 run_dump_test "ifunc-4a"
245 run_dump_test "ifunc-5a"
246 run_dump_test "ifunc-5b"
247 run_dump_test "ifunc-5a-local"
248 run_dump_test "ifunc-5b-local"
249 run_dump_test "ifunc-5r-local"
250 run_dump_test "ifunc-6a"
251 run_dump_test "ifunc-6b"
252 run_dump_test "ifunc-7a"
253 run_dump_test "ifunc-7b"
254 run_dump_test "ifunc-7c"
255 run_dump_test "ifunc-8"
256 run_dump_test "ifunc-9"
257 run_dump_test "ifunc-10"
258 run_dump_test "ifunc-11"
259 run_dump_test "ifunc-12"
260 run_dump_test "ifunc-13"
261 run_dump_test "ifunc-14a"
262 run_dump_test "ifunc-14b"
263 run_dump_test "ifunc-14c"
264 run_dump_test "ifunc-14d"
265 run_dump_test "ifunc-14e"
266 run_dump_test "ifunc-14f"
267 run_dump_test "ifunc-15"
268 run_dump_test "ifunc-16"
269 run_dump_test "ifunc-17a"
270 run_dump_test "ifunc-17b"
271 run_dump_test "ifunc-18a"
272 run_dump_test "ifunc-18b"
273 run_dump_test "ifunc-19a"
274 run_dump_test "ifunc-19b"
275 run_dump_test "ifunc-20"
276 run_dump_test "ifunc-21"
277 run_dump_test "ifunc-22"
279 run_dump_test "relasz"
280 run_dump_test "relocs-1027-symbolic-func"
282 run_dump_test "dt_textrel"
284 run_dump_test "plt_mapping_symbol"
286 run_dump_test "rela-abs-relative"
287 run_dump_test "rela-abs-relative-be"
288 run_dump_test "rela-abs-relative-opt"
290 run_dump_test "pie-bind-locally"
292 set aarch64elflinktests {
293 {"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
294 {} "copy-reloc-so.so"}
295 {"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" ""
296 {copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"}
299 run_ld_link_tests $aarch64elflinktests