2016-08-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
[binutils-gdb.git] / ld / testsuite / ld-arm / arm-elf.exp
1 # Expect script for various ARM ELF tests.
2 # Copyright (C) 2002-2016 Free Software Foundation, Inc.
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
22 if {[istarget "arm-*-vxworks"]} {
23 set armvxworkstests {
24 {"VxWorks shared library test 1" "-shared -Tvxworks1.ld" ""
25 "" {vxworks1-lib.s}
26 {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
27 {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}}
28 "libvxworks1.so"}
29 {"VxWorks executable test 1 (dynamic)" \
30 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic" ""
31 "" {vxworks1.s}
32 {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
33 "vxworks1"}
34 {"VxWorks executable test 2 (dynamic)" \
35 "-Tvxworks1.ld -q --force-dynamic" ""
36 "" {vxworks2.s}
37 {{readelf --segments vxworks2.sd}}
38 "vxworks2"}
39 {"VxWorks executable test 2 (static)"
40 "-Tvxworks1.ld" ""
41 "" {vxworks2.s}
42 {{readelf --segments vxworks2-static.sd}}
43 "vxworks2"}
44 }
45 run_ld_link_tests $armvxworkstests
46 run_dump_test "vxworks1-static"
47 run_dump_test "emit-relocs1-vxworks"
48 }
49
50 if { [istarget "arm*-*-symbianelf*"] } {
51 run_dump_test "symbian-seg1"
52 }
53
54 # Exclude non-ARM-ELF targets.
55
56 if { ![is_elf_format] || ![istarget "arm*-*-*"] } {
57 return
58 }
59
60 # List contains test-items with 3 items followed by 2 lists and one more item:
61 # 0:name 1:ld early options 2:ld late options 3:assembler options
62 # 4:filenames of assembler files 5: action and options. 6: name of output file
63
64 # Actions:
65 # objdump: Apply objdump options on result. Compare with regex (last arg).
66 # nm: Apply nm options on result. Compare with regex (last arg).
67 # readelf: Apply readelf options on result. Compare with regex (last arg).
68
69 set armelftests_common_1 {
70 {"Group relocations" "-Ttext 0x8000 -Tdata 0x3000000 --section-start alpha=0xeef0 --section-start beta=0xffeef0" "" "" {group-relocs.s}
71 {{objdump -dr group-relocs.d}}
72 "group-relocs"}
73 {"Indirect cross-library function reference (set-up)"
74 "-shared" "" "" {arm-lib-plt-2a.s}
75 {}
76 "arm-lib-plt-2a.so"}
77 {"Indirect cross-library function reference"
78 "-shared tmpdir/arm-lib-plt-2a.so" "" "" {arm-lib-plt-2b.s}
79 {{objdump -dr arm-lib-plt-2.dd} {readelf --relocs arm-lib-plt-2.rd}}
80 "arm-lib-plt-2b.so"}
81 {"Simple static application" "" "" "" {arm-static-app.s}
82 {{objdump -fdw arm-static-app.d} {objdump -rw arm-static-app.r}}
83 "arm-static-app"}
84 {"target1-abs" "-static --target1-abs -T arm.ld" "" "" {arm-target1.s}
85 {{objdump -s arm-target1-abs.d}}
86 "arm-target1-abs"}
87 {"target1-rel" "-static --target1-rel -T arm.ld" "" "" {arm-target1.s}
88 {{objdump -s arm-target1-rel.d}}
89 "arm-target1-rel"}
90 {"target2-rel" "-static --target2=rel -T arm.ld" "" "" {arm-target2.s}
91 {{objdump -s arm-target2-rel.d}}
92 "arm-target2-rel"}
93 {"target2-abs" "-static --target2=abs -T arm.ld" "" "" {arm-target2.s}
94 {{objdump -s arm-target2-abs.d}}
95 "arm-target2-abs"}
96 {"target2-got-rel" "-static --target2=got-rel -T arm.ld" "" "" {arm-target2.s}
97 {{objdump -s arm-target2-got-rel.d}}
98 "arm-target2-got-rel"}
99 {"arm-rel31" "-static -T arm.ld" "" "" {arm-rel31.s}
100 {{objdump -s arm-rel31.d}}
101 "arm-rel31"}
102 {"arm-rel32" "-shared -T arm-dyn.ld" "" "" {arm-rel32.s}
103 {{objdump -Rsj.data arm-rel32.d}}
104 "arm-rel32"}
105 {"arm-call" "--no-fix-arm1176 -static -T arm.ld" "" "-meabi=4" {arm-call1.s arm-call2.s}
106 {{objdump -d arm-call.d}}
107 "arm-call"}
108 {"TLS shared library" "-shared -T arm-lib.ld" "" "" {tls-lib.s}
109 {{objdump -fdw tls-lib.d} {objdump -Rw tls-lib.r}}
110 "tls-lib.so"}
111 {"TLS dynamic application" "-T arm-dyn.ld tmpdir/tls-lib.so" "" "" {tls-app.s}
112 {{objdump -fdw tls-app.d} {objdump -Rw tls-app.r}}
113 "tls-app"}
114 {"TLS gnu shared library got" "-shared -T arm-dyn.ld" "" "" {tls-gdesc-got.s}
115 {{objdump "-fDR -j .got" tls-gdesc-got.d}}
116 "tls-lib2-got.so"}
117 {"TLS gnu GD to IE relaxation" "-static -T arm-dyn.ld" "" "" {tls-gdierelax.s}
118 {{objdump -fdw tls-gdierelax.d}}
119 "tls-app-rel-ie"}
120 {"TLS gnu GD to IE shared relaxation" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" "" {tls-gdierelax2.s}
121 {{objdump -fdw tls-gdierelax2.d}}
122 "tls-app-rel-ie2"}
123 {"TLS gnu GD to LE relaxation" "-T arm-dyn.ld" "" "" {tls-gdlerelax.s}
124 {{objdump -fdw tls-gdlerelax.d}}
125 "tls-app-rel-le"}
126 {"TLS mixed models shared lib" "-shared -T arm-dyn.ld" "" "" {tls-mixed.s}
127 {{objdump -Rw tls-mixed.r}}
128 "tls-mixed.so"}
129 {"TLS descseq relaxation" "-T arm-dyn.ld" "" "" {tls-descrelax.s}
130 {{objdump -fdw tls-descrelax.d}}
131 "tls-descrelax"}
132 {"TLS descseq relaxation v7" "-T arm-dyn.ld" "" "" {tls-descrelax-v7.s}
133 {{objdump -fdw tls-descrelax-v7.d}}
134 "tls-descrelax-v7"}
135 {"TLS descseq relaxation BE8" "-T arm-dyn.ld -EB --be8" "" "-mbig-endian" {tls-descrelax-be8.s}
136 {{objdump -fdw tls-descrelax-be8.d}}
137 "tls-descrelax-be8"}
138 {"TLS descseq relaxation BE32" "-T arm-dyn.ld -EB" "" "-mbig-endian" {tls-descrelax-be32.s}
139 {{objdump -fdw tls-descrelax-be32.d}}
140 "tls-descrelax-be32"}
141 {"TLS local PIC symbol static link" "-T arm.ld" "" "" {tls-local-static.s}
142 {{objdump -fdw tls-local-static.d}}
143 "tls-local-static"}
144 {"MOVW/MOVT" "-static -T arm.ld" "" "" {arm-movwt.s}
145 {{objdump -dw arm-movwt.d}}
146 "arm-movwt"}
147 {"BE8 Mapping Symbols" "-static -T arm.ld -EB --be8" "" "-EB" {arm-be8.s}
148 {{objdump -d arm-be8.d}}
149 "arm-be8"}
150 {"VFP11 denorm erratum fix, scalar operation"
151 "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "" "-EL -mfpu=vfpxd" {vfp11-fix-scalar.s}
152 {{objdump -dr vfp11-fix-scalar.d}}
153 "vfp11-fix-scalar"}
154 {"VFP11 denorm erratum fix, vector operation"
155 "-EB --vfp11-denorm-fix=vector -Ttext=0x8000" "" "-EB -mfpu=vfpxd" {vfp11-fix-vector.s}
156 {{objdump -dr vfp11-fix-vector.d}}
157 "vfp11-fix-vector"}
158 {"VFP11 denorm erratum fix, embedded code-like data"
159 "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "" "-EL -mfpu=vfpxd" {vfp11-fix-none.s}
160 {{objdump -dr vfp11-fix-none.d}}
161 "vfp11-fix-none"}
162 {"STM32L4XX erratum fix LDM"
163 "-EL --fix-stm32l4xx-629360 -Ttext=0x8000" "" "-EL -mcpu=cortex-m4 -mfpu=fpv4-sp-d16" {stm32l4xx-fix-ldm.s}
164 {{objdump -dr stm32l4xx-fix-ldm.d}}
165 "stm32l4xx-fix-ldm"}
166 {"STM32L4XX erratum fix VLDM"
167 "-EL --fix-stm32l4xx-629360 -Ttext=0x8000" "" "-EL -mcpu=cortex-m4 -mfpu=fpv4-sp-d16" {stm32l4xx-fix-vldm.s}
168 {{objdump -dr stm32l4xx-fix-vldm.d}}
169 "stm32l4xx-fix-vldm"}
170 {"STM32L4XX erratum fix VLDM, DP registers"
171 "-EL --fix-stm32l4xx-629360 -Ttext=0x8000" "" "-EL -mcpu=cortex-m4 -mfpu=fpv4-sp-d16" {stm32l4xx-fix-vldm-dp.s}
172 {{objdump -dr stm32l4xx-fix-vldm-dp.d}}
173 "stm32l4xx-fix-vldm-dp"}
174 {"STM32L4XX erratum fix ALL"
175 "-EL --fix-stm32l4xx-629360=all -Ttext=0x8000" "" "-EL -mcpu=cortex-m4 -mfpu=fpv4-sp-d16" {stm32l4xx-fix-all.s}
176 {{objdump -dr stm32l4xx-fix-all.d}}
177 "stm32l4xx-fix-all"}
178 {"STM32L4XX erratum fix in IT context"
179 "-EL --fix-stm32l4xx-629360 -Ttext=0x8000" "" "-EL -mcpu=cortex-m4 -mfpu=fpv4-sp-d16" {stm32l4xx-fix-it-block.s}
180 {{objdump -dr stm32l4xx-fix-it-block.d}}
181 "stm32l4xx-fix-it-block"}
182 {"Unwinding and -gc-sections" "-gc-sections" "" "" {gc-unwind.s}
183 {{objdump -sj.data gc-unwind.d}}
184 "gc-unwind"}
185 }
186
187 set armelftests_common_2 {
188 {"script-type" "-static -T script-type.ld" "" "" {script-type.s}
189 {{readelf -s script-type.sym}}
190 "script-type"}
191 }
192
193 set armelftests_common_3 {
194 {"callweak" "-static -T arm.ld" "" "" {callweak.s}
195 {{objdump -dr callweak.d}}
196 "callweak"}
197 {"Relocation boundaries" "-defsym x=0 -defsym y=0 -defsym _start=0" "" "" {reloc-boundaries.s}
198 {{objdump -s reloc-boundaries.d}}
199 "reloc-boundaries"}
200 {"Data only mapping symbols" "-T data-only-map.ld -Map map" "" "" {data-only-map.s}
201 {{objdump -dr data-only-map.d}}
202 "data-only-map"}
203 {"Data only mapping symbols for merged sections" "-T rodata-merge-map.ld" "" "" {rodata-merge-map1.s rodata-merge-map2.s rodata-merge-map3.s}
204 {{readelf -s rodata-merge-map.sym}}
205 "rodata-merge-map"}
206 {"GOT relocations in executables (setup)" "-shared" ""
207 "" {exec-got-1a.s}
208 {}
209 "exec-got-1.so"}
210 {"GOT relocations in executables" "tmpdir/exec-got-1.so" ""
211 "" {exec-got-1b.s}
212 {{readelf --relocs exec-got-1.d}}
213 "exec-got-1"}
214 {"Simple non-PIC shared library (no PLT check)" "-shared" "" "" {arm-lib.s}
215 {{objdump -Rw arm-lib.r}}
216 "arm-lib.so"}
217 {"EABI soft-float ET_EXEC ABI flag" "-T arm.ld" "" "-mfloat-abi=soft -meabi=5" {eabi-soft-float.s}
218 {{readelf -h eabi-soft-float.d}}
219 "eabi-soft-float"}
220 {"EABI hard-float ET_EXEC ABI flag" "-T arm.ld" "" "-mfloat-abi=hard -meabi=5" {eabi-hard-float.s}
221 {{readelf -h eabi-hard-float.d}}
222 "eabi-hard-float"}
223 {"EABI hard-float ET_DYN ABI flag" "-shared" "" "-mfloat-abi=hard -meabi=5" {eabi-hard-float.s}
224 {{readelf -h eabi-hard-float.d}}
225 "eabi-hard-float.so"}
226 {"EABI ABI flags wrong ABI version" "-T arm.ld" "" "-mfloat-abi=soft -meabi=4" {eabi-soft-float.s}
227 {{readelf -h eabi-soft-float-ABI4.d}}
228 "eabi-soft-float-no-flags"}
229 {"EABI ABI flags ld -r" "-r" "" "-mfloat-abi=soft -meabi=5" {eabi-soft-float.s}
230 {{readelf -h eabi-soft-float-r.d}}
231 "eabi-soft-float-r.o"}
232 {"PC-relative in -shared" "-shared" ""
233 "" {pcrel-shared.s}
234 {{readelf -dr pcrel-shared.rd}}
235 "pcrel-shared.so"}
236 {"MOVS thumb1 relocations" "-static -T arm.ld" "" "" {thumb1-movs.s}
237 {{objdump -dw thumb1-movs.d}}
238 "thumb1-movs"}
239 {"ADDS thumb1 relocations" "-static -T arm.ld" "" "" {thumb1-adds.s}
240 {{objdump -dw thumb1-adds.d}}
241 "thumb1-adds"}
242 {"MOVS thumb1 relocations for armv7-m target" "-static -T arm.ld" "" "" {thumb1-movs-armv7-m.s}
243 {{objdump -dw thumb1-movs.d}}
244 "thumb1-movs"}
245 {"ADDS thumb1 relocations for armv7-m target" "-static -T arm.ld" "" "" {thumb1-adds-armv7-m.s}
246 {{objdump -dw thumb1-adds.d}}
247 "thumb1-adds"}
248 }
249
250 run_ld_link_tests $armelftests_common_1
251 if { ![istarget "arm*-*-netbsdelf"] } {
252 run_ld_link_tests $armelftests_common_2
253 }
254 run_ld_link_tests $armelftests_common_3
255
256
257 set armelftests_nonacl {
258 {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" "" {thumb1-bl.s}
259 {{objdump -dr thumb1-bl.d}}
260 "thumb1-bl"}
261 {"Thumb entry point" "-T arm.ld" "" "" {thumb-entry.s}
262 {{readelf -h thumb-entry.d}}
263 "thumb-entry"}
264 {"thumb-rel32" "-static -T arm.ld" "" "" {thumb-rel32.s}
265 {{objdump -s thumb-rel32.d}}
266 "thumb-rel32"}
267 {"jump19" "-static -T arm.ld" "" "" {jump19.s}
268 {{objdump -dr jump19.d}}
269 "jump19"}
270 {"Thumb and -gc-sections" "-shared -T arm-dyn.ld" "" "" {gc-thumb-lib.s}
271 {}
272 "gc-thumb-lib.so"}
273 {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" "" {gc-thumb.s}
274 {{readelf --relocs gc-thumb.d}}
275 "gc-thumb"}
276
277 {"Simple non-PIC shared library" "-shared" "" "" {arm-lib.s}
278 {{objdump -fdw arm-lib.d} {objdump -Rw arm-lib.r}}
279 "arm-lib.so"}
280 {"Simple PIC shared library" "-shared" "" "" {arm-lib-plt32.s}
281 {{objdump -fdw arm-lib-plt32.d} {objdump -Rw arm-lib-plt32.r}}
282 "arm-lib-plt32.so"}
283 {"Simple dynamic application" "tmpdir/arm-lib.so" "" "" {arm-app.s}
284 {{objdump -fdw arm-app.d} {objdump -Rw arm-app.r}}
285 "arm-app"}
286 {"Simple static application without .rel.plt in linker script"
287 "-T arm-no-rel-plt.ld" "" "" {arm-static-app.s}
288 {{objdump -fdw arm-static-app.d} {objdump -rw arm-static-app.r}}
289 "arm-static-app-no-rel-plt"}
290 {"Simple dynamic application without .rel.plt in linker script"
291 "tmpdir/arm-lib.so -T arm-no-rel-plt.ld" "" "" {arm-app.s}
292 {{readelf -dr arm-no-rel-plt.r}}
293 "arm-app-no-rel-plt"}
294 {"Non-pcrel function reference" "tmpdir/arm-lib.so" "" "" {arm-app-abs32.s}
295 {{objdump -fdw arm-app-abs32.d} {objdump -Rw arm-app-abs32.r}}
296 "arm-app-abs32"}
297 {"Thumb shared library with ARM entry points" "-shared -T arm-lib.ld" "" "-mthumb-interwork"
298 {mixed-lib.s}
299 {{objdump -fdw armthumb-lib.d} {readelf -Ds armthumb-lib.sym}}
300 "armthumb-lib.so"}
301 {"Mixed ARM/Thumb shared library" "-shared -T arm-lib.ld -use-blx" "" ""
302 {mixed-lib.s}
303 {{objdump -fdw mixed-lib.d} {objdump -Rw mixed-lib.r}
304 {readelf -Ds mixed-lib.sym}}
305 "mixed-lib.so"}
306 {"Mixed ARM/Thumb dynamic application" "tmpdir/mixed-lib.so -T arm-dyn.ld" "" ""
307 {mixed-app.s}
308 {{objdump -fdw mixed-app.d} {objdump -Rw mixed-app.r}
309 {readelf -Ds mixed-app.sym}}
310 "mixed-app"}
311 {"Mixed ARM/Thumb arch5 dynamic application" "tmpdir/mixed-lib.so -T arm-dyn.ld --use-blx" "" ""
312 {mixed-app.s}
313 {{objdump -fdw mixed-app-v5.d} {objdump -Rw mixed-app.r}
314 {readelf -Ds mixed-app.sym}}
315 "mixed-app-v5"}
316 {"Using Thumb lib by another lib" "-shared tmpdir/mixed-lib.so" "" "" {use-thumb-lib.s}
317 {{readelf -Ds use-thumb-lib.sym}}
318 "use-thumb-lib.so"}
319 {"TLS gnu shared library inlined trampoline" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" "" {tls-descseq.s}
320 {{objdump -fdw tls-descseq.d} {objdump -Rw tls-descseq.r}}
321 "tls-lib2inline.so"}
322 {"TLS shared library gdesc local" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" "" {tls-lib-loc.s}
323 {{objdump -fdw tls-lib-loc.d} {objdump -Rw tls-lib-loc.r}}
324 "tls-lib-loc.so"}
325 }
326
327 if { ![istarget "arm*-*-nacl*"] } {
328 run_ld_link_tests $armelftests_nonacl
329 }
330
331 run_dump_test "group-relocs-alu-bad"
332 run_dump_test "group-relocs-alu-bad-2"
333 run_dump_test "group-relocs-ldr-bad"
334 run_dump_test "group-relocs-ldr-bad-2"
335 run_dump_test "group-relocs-ldrs-bad"
336 run_dump_test "group-relocs-ldrs-bad-2"
337 run_dump_test "group-relocs-ldc-bad"
338 run_dump_test "group-relocs-ldc-bad-2"
339 run_dump_test "thumb2-bl-undefweak"
340 run_dump_test "thumb2-bl-undefweak1"
341 run_dump_test "emit-relocs1"
342 run_dump_test "movw-shared-1"
343 run_dump_test "movw-shared-2"
344 run_dump_test "movw-shared-3"
345 run_dump_test "movw-shared-4"
346 run_dump_test "rel32-reject"
347 run_dump_test "rel32-reject-pie"
348
349 # Exclude non-ARM-EABI targets.
350
351 if { [istarget "arm*-*-netbsdelf"] } {
352 return
353 }
354
355 if { ![istarget "arm*-*-*eabi*"] && ![istarget "arm*-*-nacl*"] } {
356 # Special variants of these tests, as a different farcall stub is
357 # generated for a non-ARM-EABI target: indeed in such a case,
358 # there are no attributes to indicate that blx can be used.
359
360 set arm_noeabi_tests {
361 {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-as-thumb1-bad.s}
362 {{objdump -d thumb2-bl-as-thumb1-bad-noeabi.d}}
363 "thumb2-bl-as-thumb1-bad"}
364 {"Thumb-2 BL bad" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s}
365 {{objdump -d thumb2-bl-bad-noeabi.d}}
366 "thumb2-bl-bad"}
367 }
368 run_ld_link_tests $arm_noeabi_tests
369
370 return
371 }
372
373 # Farcalls stubs are fully supported for ARM-EABI only.
374 # This list is massaged below into run_ld_link_tests standard format.
375 # The source list is almost that same format. The one difference is
376 # that each "action" (elements of element 5) might have four elements
377 # instead of three; in that case, the fourth element is the name of
378 # the dump file to use for arm*-*nacl* targets instead of the canonical
379 # dump file (the third element).
380 set armeabitests_common {
381 {"EABI attribute merging" "-r" "" "" {attr-merge.s attr-merge.s}
382 {{readelf -A attr-merge.attr}}
383 "attr-merge"}
384 {"EABI attribute merging 2" "-r" "" "" {attr-merge-2a.s attr-merge-2b.s}
385 {{readelf -A attr-merge-2.attr}}
386 "attr-merge-2"}
387 {"EABI attribute merging 3" "-r" "" "" {attr-merge-3a.s attr-merge-3b.s}
388 {{readelf -A attr-merge-3.attr}}
389 "attr-merge-3"}
390 {"EABI attribute merging 4" "-r" "" "" {attr-merge-4a.s attr-merge-4b.s}
391 {{readelf -A attr-merge-4.attr}}
392 "attr-merge-4"}
393 {"EABI attribute merging 5" "-r" "" "" {attr-merge-5.s attr-merge-5.s}
394 {{readelf -A attr-merge-5.attr}}
395 "attr-merge-5"}
396 {"EABI attribute merging 6" "-r" "" "" {attr-merge-6a.s attr-merge-6b.s}
397 {{readelf -A attr-merge-6.attr}}
398 "attr-merge-6"}
399 {"EABI attribute merging 6 reversed" "-r" "" "" {attr-merge-6b.s attr-merge-6a.s}
400 {{readelf -A attr-merge-6.attr}}
401 "attr-merge-6r"}
402 {"EABI attribute merging 7" "-r" "" "" {attr-merge-7a.s attr-merge-7b.s}
403 {{readelf -A attr-merge-7.attr}}
404 "attr-merge-7"}
405 {"EABI attribute merging 8" "-r" "" "" {attr-merge-8a.s attr-merge-8b.s}
406 {{readelf -A attr-merge-8.attr}}
407 "attr-merge-8"}
408 {"EABI attribute merging 9" "-r" "" "" {attr-merge-9a.s attr-merge-9b.s}
409 {{ld attr-merge-9.out}}
410 "attr-merge-9"}
411 {"EABI attribute merging 10" "-r" "" "" {attr-merge-10a.s attr-merge-10b.s}
412 {{readelf -A attr-merge-10.attr}}
413 "attr-merge-10"}
414 {"EABI attribute merging 10 (DSP)" "-r" "" "" {attr-merge-10a.s attr-merge-10b-dsp.s}
415 {{readelf -A attr-merge-10-dsp.attr}}
416 "attr-merge-10-dsp"}
417 {"EABI attribute arch merging 1" "-r" "" "" {arch-v6k.s arch-v6t2.s}
418 {{readelf -A attr-merge-arch-1.attr}}
419 "attr-merge-arch-1"}
420 {"EABI attribute arch merging 1 reversed" "-r" "" "" {arch-v6t2.s arch-v6k.s}
421 {{readelf -A attr-merge-arch-1.attr}}
422 "attr-merge-arch-1r"}
423 {"EABI attribute arch merging 2" "-r" "" "" {arch-v6k.s arch-v6.s}
424 {{readelf -A attr-merge-arch-2.attr}}
425 "attr-merge-arch-2"}
426 {"EABI attribute arch merging 2 reversed" "-r" "" "" {arch-v6.s arch-v6k.s}
427 {{readelf -A attr-merge-arch-2.attr}}
428 "attr-merge-arch-2r"}
429 {"MOVW/MOVT and merged sections" "-T arm.ld" "" "" {movw-merge.s}
430 {{objdump -dw movw-merge.d}}
431 "movw-merge"}
432 {"MOVW/MOVT against shared libraries" "tmpdir/arm-lib.so" "" "" {arm-app-movw.s}
433 {{objdump -Rw arm-app.r}}
434 "arm-app-movw"}
435
436 {"ARM-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-arm-arm.s}
437 {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}}
438 "farcall-arm-arm"}
439 {"ARM-ARM farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001020 --pic-veneer" "" "" {farcall-arm-arm.s}
440 {{objdump -d farcall-arm-arm-pic-veneer.d farcall-arm-nacl-pic.d}}
441 "farcall-arm-arm-pic-veneer"}
442 {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "" "-EB" {farcall-arm-arm.s}
443 {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}}
444 "farcall-arm-arm-be8"}
445 {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "" "-EB" {farcall-arm-arm.s}
446 {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}}
447 "farcall-arm-arm-be"}
448
449 {"Long branch with mixed text and data" "-T arm.ld" "" "" {farcall-data.s}
450 {{objdump -dr farcall-data.d farcall-data-nacl.d}}
451 "farcall-data"}
452 {"callweak-2" "-static -T arm.ld" "" "" {callweak-2.s}
453 {{objdump -dr callweak-2.d}}
454 "callweak-2"}
455 {"abs call" "-T arm.ld" "" "" {abs-call-1.s}
456 {{objdump -d abs-call-1.d}}
457 "abs-call-1"}
458 }
459
460 set armeabitests_nonacl {
461 {"ARM-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "" {farcall-arm-thumb.s}
462 {{objdump -d farcall-arm-thumb.d}}
463 "farcall-arm-thumb"}
464 {"ARM-Thumb farcall with BLX" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv5t" {farcall-arm-thumb.s}
465 {{objdump -d farcall-arm-thumb-blx.d}}
466 "farcall-arm-thumb-blx"}
467 {"ARM-Thumb farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "" "" {farcall-arm-thumb.s}
468 {{objdump -d farcall-arm-thumb-pic-veneer.d}}
469 "farcall-arm-thumb-pic-veneer"}
470 {"ARM-Thumb farcall with BLX (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "" "-march=armv5t" {farcall-arm-thumb.s}
471 {{objdump -d farcall-arm-thumb-blx-pic-veneer.d}}
472 "farcall-arm-thumb-blx-pic-veneer"}
473
474 {"Thumb-Thumb farcall with BLX" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv5t" {farcall-thumb-thumb.s}
475 {{objdump -d farcall-thumb-thumb-blx.d}}
476 "farcall-thumb-thumb-blx"}
477 {"Thumb-Thumb farcall M profile" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv6-m" {farcall-thumb-thumb.s}
478 {{objdump -d farcall-thumb-thumb-m.d}}
479 "farcall-thumb-thumb-m"}
480 {"Thumb2-Thumb2 farcall M profile" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv7-m" {farcall-thumb-thumb.s}
481 {{objdump -d farcall-thumb2-thumb2-m.d}}
482 "farcall-thumb2-thumb2-m"}
483 {"Thumb-Thumb farcall v8-M Baseline" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv8-m.base" {farcall-thumb-thumb.s}
484 {{objdump -d farcall-thumb-thumb-m.d}}
485 "farcall-thumb-thumb-v8-m-base"}
486 {"Thumb-Thumb farcall v8-M Mainline" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv8-m.main" {farcall-thumb-thumb.s}
487 {{objdump -d farcall-thumb-thumb-m.d}}
488 "farcall-thumb-thumb-v8-m-main"}
489 {"Thumb-Thumb farcall v6-M" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv6-m" {farcall-thumb-thumb.s}
490 {{objdump -d farcall-thumb-thumb-m.d}}
491 "farcall-thumb-thumb-v6-m"}
492 {"Thumb-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "-march=armv4t" {farcall-thumb-thumb.s}
493 {{objdump -d farcall-thumb-thumb.d}}
494 "farcall-thumb-thumb"}
495 {"Thumb-Thumb farcall with BLX (PIC veneer)" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "" "-march=armv5t" {farcall-thumb-thumb.s}
496 {{objdump -d farcall-thumb-thumb-blx-pic-veneer.d}}
497 "farcall-thumb-thumb-blx-pic-veneer"}
498 {"Thumb-Thumb farcall M profile (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "" "-march=armv7-m" {farcall-thumb-thumb.s}
499 {{objdump -d farcall-thumb-thumb-m-pic-veneer.d}}
500 "farcall-thumb-thumb-m-pic-veneer"}
501 {"Thumb-Thumb farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "" "-march=armv4t" {farcall-thumb-thumb.s}
502 {{objdump -d farcall-thumb-thumb-pic-veneer.d}}
503 "farcall-thumb-thumb-pic-veneer"}
504 {"Thumb-Thumb farcall v6-M (no profile)" "-Ttext 0x1000 --section-start .foo=0x2001014" "" ""
505 {farcall-thumb-thumb-m-no-profile-a.s farcall-thumb-thumb-m-no-profile-b.s}
506 {{objdump -d farcall-thumb-thumb-m-no-profile.d}}
507 "farcall-thumb-thumb-m-no-profile"}
508 {"Thumb2 purecode farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-thumb2-purecode.s}
509 {{objdump -d farcall-thumb2-purecode.d}}
510 "farcall-thumb2-purecode"}
511
512 {"Thumb-ARM farcall" "-Ttext 0x1c01010 --section-start .foo=0x2001014" "" "-W" {farcall-thumb-arm.s}
513 {{objdump -d farcall-thumb-arm.d}}
514 "farcall-thumb-arm"}
515 {"Thumb-ARM farcall (BE8)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 -EB --be8" "" "-W -EB" {farcall-thumb-arm.s}
516 {{objdump -d farcall-thumb-arm.d}}
517 "farcall-thumb-arm-be8"}
518 {"Thumb-ARM farcall (BE)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 -EB" "" "-W -EB" {farcall-thumb-arm.s}
519 {{objdump -d farcall-thumb-arm.d}}
520 "farcall-thumb-arm-be"}
521 {"Thumb-ARM (short) call" "-Ttext 0x1000 --section-start .foo=0x0002014" "" "-W" {farcall-thumb-arm-short.s}
522 {{objdump -d farcall-thumb-arm-short.d}}
523 "farcall-thumb-arm-short"}
524 {"Thumb-ARM farcall with BLX" "--no-fix-arm1176 -Ttext 0x1c01010 --section-start .foo=0x2001014" "" "-W -march=armv5t" {farcall-thumb-arm.s}
525 {{objdump -d farcall-thumb-arm-blx.d}}
526 "farcall-thumb-arm-blx"}
527 {"Thumb-ARM farcall with BLX (PIC veneer)" "--no-fix-arm1176 -Ttext 0x1c01010 --section-start .foo=0x2001014 --pic-veneer" "" "-W -march=armv5t" {farcall-thumb-arm.s}
528 {{objdump -d farcall-thumb-arm-blx-pic-veneer.d}}
529 "farcall-thumb-arm-blx-pic-veneer"}
530 {"Thumb-ARM farcall (PIC veneer)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 --pic-veneer" "" "-W" {farcall-thumb-arm.s}
531 {{objdump -d farcall-thumb-arm-pic-veneer.d}}
532 "farcall-thumb-arm-pic-veneer"}
533
534 {"Thumb-ARM farcall cond" "-Ttext 0x8000 --section-start .foo=0x118000" "" "-W" {farcall-cond-thumb-arm.s}
535 {{objdump -d farcall-cond-thumb-arm.d}}
536 "farcall-cond-thumb-arm"}
537 {"Thumb-ARM farcall cond (BE8)" "-Ttext 0x8000 --section-start .foo=0x118000 -EB --be8" "" "-W -EB" {farcall-cond-thumb-arm.s}
538 {{objdump -d farcall-cond-thumb-arm.d}}
539 "farcall-cond-thumb-arm-be8"}
540 {"Thumb-ARM farcall cond (BE)" "-Ttext 0x8000 --section-start .foo=0x118000 -EB" "" "-W -EB" {farcall-cond-thumb-arm.s}
541 {{objdump -d farcall-cond-thumb-arm.d}}
542 "farcall-cond-thumb-arm-be"}
543
544 {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" "" {farcall-mix.s}
545 {{objdump -d farcall-mix.d}}
546 "farcall-mix"}
547 {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" "" {farcall-mix2.s}
548 {{objdump -d farcall-mix2.d}}
549 "farcall-mix2"}
550
551 {"Mixed ARM/Thumb dynamic application with farcalls" "tmpdir/mixed-lib.so -T arm-dyn.ld --section-start .far_arm=0x2100000 --section-start .far_thumb=0x2200000" "" ""
552 {farcall-mixed-app.s}
553 {{objdump -fdw farcall-mixed-app.d} {objdump -Rw farcall-mixed-app.r}
554 {readelf -Ds farcall-mixed-app.sym}}
555 "farcall-mixed-app"}
556 {"Mixed ARM/Thumb arch5 dynamic application with farcalls" "tmpdir/mixed-lib.so -T arm-dyn.ld --use-blx --section-start .far_arm=0x2100000 --section-start .far_thumb=0x2200000" "" ""
557 {farcall-mixed-app.s}
558 {{objdump -fdw farcall-mixed-app-v5.d} {objdump -Rw farcall-mixed-app.r}
559 {readelf -Ds farcall-mixed-app.sym}}
560 "farcall-mixed-app-v5"}
561
562 {"Mixed ARM/Thumb shared library with long branches (v4t)" "-shared -T arm-lib.ld" "" "-march=armv4t"
563 {farcall-mixed-lib1.s farcall-mixed-lib2.s}
564 {{objdump -fdw farcall-mixed-lib-v4t.d}}
565 "farcall-mixed-lib.so"}
566
567 {"Mixed ARM/Thumb shared library with long branches (v5t)" "--no-fix-arm1176 -shared -T arm-lib.ld" "" "-march=armv5t"
568 {farcall-mixed-lib1.s farcall-mixed-lib2.s}
569 {{objdump -fdw farcall-mixed-lib.d}}
570 "farcall-mixed-lib.so"}
571
572 {"Thumb-2-as-Thumb-1 BL" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-as-thumb1-bad.s}
573 {{objdump -d thumb2-bl-as-thumb1-bad.d}}
574 "thumb2-bl-as-thumb1-bad"}
575 {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s}
576 {{objdump -d thumb2-bl-bad.d}}
577 "thumb2-bl-bad"}
578 {"Branch to linker script symbol with BL for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-bl-lks-sym.s}
579 {{objdump -d thumb-bl-lks-sym.d}}
580 "thumb-bl-lks-sym"}
581 {"Branch to linker script symbol with B for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-b-lks-sym.s}
582 {{objdump -d thumb-b-lks-sym.d}}
583 "thumb-b-lks-sym"}
584
585 {"erratum 760522 fix (default for v6z)" "--section-start=.foo=0x2001014" ""
586 "-march=armv6z" {fix-arm1176.s}
587 {{objdump -d fix-arm1176-on.d}}
588 "fix-arm1176-1"}
589 {"erratum 760522 fix (explicitly on at v6z)" "--section-start=.foo=0x2001014 --fix-arm1176" ""
590 "-march=armv6z" {fix-arm1176.s}
591 {{objdump -d fix-arm1176-on.d}}
592 "fix-arm1176-2"}
593 {"erratum 760522 fix (explicitly off at v6z)" "--section-start=.foo=0x2001014 --no-fix-arm1176" ""
594 "-march=armv6z" {fix-arm1176.s}
595 {{objdump -d fix-arm1176-off.d}}
596 "fix-arm1176-3"}
597 {"erratum 760522 fix (default for v5)" "--section-start=.foo=0x2001014 " ""
598 "-march=armv5te" {fix-arm1176.s}
599 {{objdump -d fix-arm1176-on.d}}
600 "fix-arm1176-4"}
601 {"erratum 760522 fix (default for v7-a)" "--section-start=.foo=0x2001014 " ""
602 "-march=armv7-a" {fix-arm1176.s}
603 {{objdump -d fix-arm1176-off.d}}
604 "fix-arm1176-5"}
605 {"erratum 760522 fix (default for ARM1156)" "--section-start=.foo=0x2001014 " ""
606 "-mcpu=arm1156t2f-s" {fix-arm1176.s}
607 {{objdump -d fix-arm1176-off.d}}
608 "fix-arm1176-6"}
609
610 {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv7" {thumb2-bl.s}
611 {{objdump -dr thumb2-bl.d}}
612 "thumb2-bl"}
613 {"Thumb-2 BL on ARMv6-M" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv6-m" {thumb2-bl.s}
614 {{objdump -dr thumb2-bl.d}}
615 "thumb2-armv6m-bl"}
616 {"Thumb-2 Interworked branch" "-T arm.ld" "" "" {thumb2-b-interwork.s}
617 {{objdump -dr thumb2-b-interwork.d}}
618 "thumb2-b-interwork"}
619 {"BL/BLX interworking" "-T arm.ld" "" "" {thumb2-bl-blx-interwork.s}
620 {{objdump -dr thumb2-bl-blx-interwork.d}}
621 "thumb2-bl-blx-interwork"}
622 {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "" "--fix-v4bx -meabi=4" {armv4-bx.s}
623 {{objdump -d armv4-bx.d}}
624 "armv4-bx"}
625
626 {"R_ARM_THM_JUMP24 Relocation veneers: Short 1"
627 "--no-fix-arm1176 --section-start destsect=0x00009000 --section-start .text=0x8000" ""
628 "-march=armv7-a -mthumb"
629 {jump-reloc-veneers.s}
630 {{objdump -d jump-reloc-veneers-short1.d}}
631 "jump-reloc-veneers-short1"}
632 {"R_ARM_THM_JUMP24 Relocation veneers: Short 2"
633 "--no-fix-arm1176 --section-start destsect=0x00900000 --section-start .text=0x8000" ""
634 "-march=armv7-a -mthumb"
635 {jump-reloc-veneers.s}
636 {{objdump -d jump-reloc-veneers-short2.d}}
637 "jump-reloc-veneers-short2"}
638 {"R_ARM_THM_JUMP24 Relocation veneers: Long"
639 "--no-fix-arm1176 --section-start destsect=0x09000000 --section-start .text=0x8000" ""
640 "-march=armv7-a -mthumb"
641 {jump-reloc-veneers.s}
642 {{objdump -d jump-reloc-veneers-long.d}}
643 "jump-reloc-veneers-long"}
644
645 {"Secure gateway veneers: no .gnu.sgstubs section" "" ""
646 "-march=armv8-m.base -mthumb"
647 {cmse-veneers.s}
648 {{ld cmse-veneers-no-gnu_sgstubs.out}}
649 "cmse-veneers-no-gnu_sgstubs"}
650 {"Secure gateway veneers: wrong entry functions" "" ""
651 "-march=armv7-m -mthumb --defsym CHECK_ERRORS=1"
652 {cmse-veneers.s}
653 {{ld cmse-veneers-wrong-entryfct.out}}
654 "cmse-veneers-wrong-entryfct"}
655 {"Secure gateway veneers (ARMv8-M Baseline)"
656 "-Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --gc-sections" ""
657 "-march=armv8-m.base -mthumb"
658 {cmse-veneers.s}
659 {{objdump {-d -j .gnu.sgstubs} cmse-veneers.d}
660 {objdump {-h -j .gnu.sgstubs} cmse-veneers.sd}
661 {nm {} cmse-veneers.rd}}
662 "cmse-veneers-baseline"}
663 {"Secure gateway veneers (ARMv8-M Mainline)"
664 "-Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --gc-sections" ""
665 "-march=armv8-m.main -mthumb"
666 {cmse-veneers.s}
667 {{objdump {-d -j .gnu.sgstubs} cmse-veneers.d}
668 {objdump {-h -j .gnu.sgstubs} cmse-veneers.sd}
669 {nm {} cmse-veneers.rd}}
670 "cmse-veneers-mainline"}
671
672 {"R_ARM_THM_JUMP19 Relocation veneers: Short"
673 "--section-start destsect=0x000108002 --section-start .text=0x8000" ""
674 "-march=armv7-m -mthumb"
675 {jump-reloc-veneers-cond.s}
676 {{objdump -d jump-reloc-veneers-cond-short.d}}
677 "jump-reloc-veneers-cond-short"}
678 {"R_ARM_THM_JUMP19 Relocation veneers: Long"
679 "--section-start destsect=0x00108004 --section-start .text=0x8000" ""
680 "-march=armv7-m -mthumb"
681 {jump-reloc-veneers-cond.s}
682 {{objdump -d jump-reloc-veneers-cond-long.d}}
683 "jump-reloc-veneers-cond-long"}
684 {"R_ARM_THM_JUMP19 Relocation veneers: Short backward"
685 "--section-start destsect=0x8004 --section-start .text=0x108000" ""
686 "-march=armv7-m -mthumb"
687 {jump-reloc-veneers-cond.s}
688 {{objdump -d jump-reloc-veneers-cond-short-backward.d}}
689 "jump-reloc-veneers-cond-short-backward"}
690 {"R_ARM_THM_JUMP19 Relocation veneers: Long backward"
691 "--section-start destsect=0x8002 --section-start .text=0x108000" ""
692 "-march=armv7-m -mthumb"
693 {jump-reloc-veneers-cond.s}
694 {{objdump -d jump-reloc-veneers-cond-long-backward.d}}
695 "jump-reloc-veneers-cond-long-backward"}
696
697 {"Default group size" "-Ttext 0x1000 --section-start .foo=0x2003020" "" "" {farcall-group.s farcall-group2.s}
698 {{objdump -d farcall-group.d}}
699 "farcall-group-default"}
700 {"Group size=2" "-Ttext 0x1000 --section-start .foo=0x2003020 --stub-group-size=2" "" "" {farcall-group.s farcall-group2.s}
701 {{objdump -d farcall-group-size2.d}}
702 "farcall-group-size2"}
703 {"Group size limit" "-Ttext 0x1000 --section-start .far=0x2003020" "" "" {farcall-group3.s farcall-group4.s}
704 {{objdump -d farcall-group-limit.d}}
705 "farcall-group-limit"}
706
707 {"TLS gnu shared library" "--no-fix-arm1176 -shared -T arm-dyn.ld" "" "" {tls-gdesc.s}
708 {{objdump -fdw tls-gdesc.d} {objdump -Rw tls-gdesc.r}}
709 "tls-lib2.so"}
710 {"TLS gnu shared library non-lazy" "-z now -shared -T arm-dyn.ld" "" "" {tls-gdesc.s}
711 {{readelf "-x .got" tls-gdesc-nlazy.g}}
712 "tls-lib2-nlazy.so"}
713 {"TLS long plt library" "-shared -T arm-dyn.ld --section-start .foo=0x4001000" "" "" {tls-longplt-lib.s}
714 {{objdump -fdw tls-longplt-lib.d}}
715 "tls-longplt-lib.so"}
716 {"TLS long plt" "-T arm-dyn.ld --section-start .foo=0x4001000 tmpdir/tls-longplt-lib.so" "" "" {tls-longplt.s}
717 {{objdump -fdw tls-longplt.d}}
718 "tls-longplt"}
719 {"TLS thumb1" "-shared -T arm-dyn.ld --section-start .foo=0x4001000" "" "" {tls-thumb1.s}
720 {{objdump -fdw tls-thumb1.d}}
721 "tls-thumb1"}
722 {"Cortex-A8 erratum fix, b.w"
723 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-b.s}
724 {{objdump -dr cortex-a8-fix-b.d}}
725 "cortex-a8-fix-b"}
726 {"Cortex-A8 erratum fix, bl.w"
727 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-bl.s}
728 {{objdump -dr cortex-a8-fix-bl.d}}
729 "cortex-a8-fix-bl"}
730 {"Cortex-A8 erratum fix, bcc.w"
731 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-bcc.s}
732 {{objdump -dr cortex-a8-fix-bcc.d}}
733 "cortex-a8-fix-bcc"}
734 {"Cortex-A8 erratum fix, blx.w"
735 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx.s}
736 {{objdump -dr cortex-a8-fix-blx.d}}
737 "cortex-a8-fix-blx"}
738 {"Cortex-A8 erratum fix, relocate b.w to ARM"
739 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s}
740 {{objdump -dr cortex-a8-fix-b-rel-arm.d}}
741 "cortex-a8-fix-b-rel-arm"}
742 {"Cortex-A8 erratum fix, relocate b.w to Thumb"
743 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s}
744 {{objdump -dr cortex-a8-fix-b-rel-thumb.d}}
745 "cortex-a8-fix-b-rel-thumb"}
746 {"Cortex-A8 erratum fix, relocate bl.w to ARM"
747 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s}
748 {{objdump -dr cortex-a8-fix-bl-rel-arm.d}}
749 "cortex-a8-fix-bl-rel-arm"}
750 {"Cortex-A8 erratum fix, relocate bl.w to Thumb"
751 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
752 {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}}
753 "cortex-a8-fix-bl-rel-thumb"}
754 {"Cortex-A8 erratum fix, relocate b<cond>.w to Thumb"
755 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s}
756 {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}}
757 "cortex-a8-fix-bcc-rel-thumb"}
758 {"Cortex-A8 erratum fix, relocate blx.w to ARM"
759 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s}
760 {{objdump -dr cortex-a8-fix-blx-rel-arm.d}}
761 "cortex-a8-fix-blx-rel-arm"}
762 {"Cortex-A8 erratum fix, relocate blx.w to Thumb"
763 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s}
764 {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}}
765 "cortex-a8-fix-blx-rel-thumb"}
766 {"Cortex-A8 erratum fix, relocate bl.w and far call"
767 "-EL -Ttext=0x00 --fix-cortex-a8 --defsym _start=0" ""
768 "-EL -mcpu=cortex-a8" {cortex-a8-far-1.s cortex-a8-far-2.s cortex-a8-far-3.s}
769 {{objdump -dr cortex-a8-far.d}}
770 "cortex-a8-far"}
771 {"Cortex-A8 erratum fix, headers"
772 "-EL --fix-cortex-a8 -T cortex-a8-fix-hdr.t" ""
773 "-EL -mcpu=cortex-a8" {cortex-a8-fix-hdr.s}
774 {{objdump -dr cortex-a8-fix-hdr.d}}
775 "cortex-a8-fix-hdr"}
776 {"Cortex-A8 erratum fix, blx.w and b<cond>.w together"
777 "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx-bcond.s}
778 {{objdump -dr cortex-a8-fix-blx-bcond.d}}
779 "cortex-a8-fix-blx-bcond"}
780 {"Cortex-A8 erratum fix, b.w to PLT"
781 "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "" "-EL"
782 {cortex-a8-fix-b-plt.s}
783 {{objdump -dr cortex-a8-fix-b-plt.d}}
784 "cortex-a8-fix-b-plt"}
785 {"Cortex-A8 erratum fix, bl.w to PLT"
786 "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "" "-EL"
787 {cortex-a8-fix-bl-plt.s}
788 {{objdump -dr cortex-a8-fix-bl-plt.d}}
789 "cortex-a8-fix-bl-plt"}
790 {"Cortex-A8 erratum fix, bcc.w to PLT"
791 "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "" "-EL"
792 {cortex-a8-fix-bcc-plt.s}
793 {{objdump -dr cortex-a8-fix-bcc-plt.d}}
794 "cortex-a8-fix-bcc-plt"}
795 {"Cortex-A8 erratum fix, blx.w to PLT"
796 "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "" "-EL"
797 {cortex-a8-fix-blx-plt.s}
798 {{objdump -dr cortex-a8-fix-blx-plt.d}}
799 "cortex-a8-fix-blx-plt"}
800 {"Cortex-A8 erratum fix, relocate bl.w to PLT"
801 "-EL --section-start=.plt=0x8e00 -Ttext=0x8f00 --fix-cortex-a8 -shared" ""
802 "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
803 {{objdump -dr cortex-a8-fix-bl-rel-plt.d}}
804 "cortex-a8-fix-bl-rel-thumb"}
805 {"IFUNC test 1" "-T ifunc-static.ld" "" "" {ifunc-1.s}
806 {{objdump -d ifunc-1.dd}
807 {objdump {-s -j.data -j.got} ifunc-1.gd}
808 {readelf -dr ifunc-1.rd}}
809 "ifunc-1"}
810 {"IFUNC test 2" "-T ifunc-static.ld" "" "" {ifunc-2.s}
811 {{objdump -d ifunc-2.dd}
812 {objdump {-s -j.data -j.got} ifunc-2.gd}
813 {readelf -dr ifunc-2.rd}}
814 "ifunc-2"}
815 {"IFUNC test 3" "-T ifunc-dynamic.ld -shared" "" "" {ifunc-3.s}
816 {{objdump -d ifunc-3.dd}
817 {objdump {-s -j.data -j.got} ifunc-3.gd}
818 {readelf -r ifunc-3.rd}}
819 "ifunc-3.so"}
820 {"IFUNC test 4" "-T ifunc-dynamic.ld -shared" "" "" {ifunc-4.s}
821 {{objdump -d ifunc-4.dd}
822 {objdump {-s -j.data -j.got} ifunc-4.gd}
823 {readelf -r ifunc-4.rd}}
824 "ifunc-4.so"}
825 {"IFUNC test 5" "-T ifunc-static.ld" "" "" {ifunc-5.s}
826 {{objdump -d ifunc-5.dd}
827 {objdump {-s -j.data -j.got} ifunc-5.gd}
828 {readelf -dr ifunc-5.rd}}
829 "ifunc-5"}
830 {"IFUNC test 6" "-T ifunc-static.ld" "" "" {ifunc-6.s}
831 {{objdump -d ifunc-6.dd}
832 {objdump {-s -j.data -j.got} ifunc-6.gd}
833 {readelf -dr ifunc-6.rd}}
834 "ifunc-6"}
835 {"IFUNC test 7" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so -shared" ""
836 "" {ifunc-7.s}
837 {{objdump -d ifunc-7.dd}
838 {objdump {-s -j.data -j.got} ifunc-7.gd}
839 {readelf -r ifunc-7.rd}}
840 "ifunc-7.so"}
841 {"IFUNC test 8" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so -shared" ""
842 "" {ifunc-8.s}
843 {{objdump -d ifunc-8.dd}
844 {objdump {-s -j.data -j.got} ifunc-8.gd}
845 {readelf -r ifunc-8.rd}}
846 "ifunc-8.so"}
847 {"IFUNC test 9" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so" "" "" {ifunc-9.s}
848 {{objdump -d ifunc-9.dd}
849 {objdump {-s -j.data -j.got} ifunc-9.gd}
850 {readelf -r ifunc-9.rd}}
851 "ifunc-9"}
852 {"IFUNC test 10" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so" "" "" {ifunc-10.s}
853 {{objdump -d ifunc-10.dd}
854 {objdump {-s -j.data -j.got} ifunc-10.gd}
855 {readelf -r ifunc-10.rd}}
856 "ifunc-10"}
857 {"IFUNC test 11" "-T ifunc-static.ld" "" "" {ifunc-11.s}
858 {{objdump -d ifunc-11.dd}
859 {objdump {-s -j.data -j.got} ifunc-11.gd}
860 {readelf -dr ifunc-11.rd}}
861 "ifunc-11"}
862 {"IFUNC test 12" "-T ifunc-dynamic.ld -shared" "" "" {ifunc-12.s}
863 {{objdump -d ifunc-12.dd}
864 {objdump {-s -j.data -j.got} ifunc-12.gd}
865 {readelf -r ifunc-12.rd}}
866 "ifunc-12.so"}
867 {"IFUNC test 13" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-13.s}
868 {{objdump -d ifunc-13.dd}
869 {objdump {-s -j.data -j.got} ifunc-13.gd}
870 {readelf -r ifunc-13.rd}}
871 "ifunc-13"}
872 {"IFUNC test 14" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-14.s}
873 {{objdump -d ifunc-14.dd}
874 {objdump {-s -j.data -j.got} ifunc-14.gd}
875 {readelf -r ifunc-14.rd}}
876 "ifunc-14"}
877 {"IFUNC test 15" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-15.s}
878 {{objdump -d ifunc-15.dd}
879 {objdump {-s -j.data -j.got} ifunc-15.gd}
880 {readelf -r ifunc-15.rd}}
881 "ifunc-15"}
882 {"IFUNC test 16" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-16.s}
883 {{objdump -d ifunc-16.dd}
884 {objdump {-s -j.data -j.got} ifunc-16.gd}
885 {readelf -r ifunc-16.rd}}
886 "ifunc-16"}
887 {"IFUNC test 17" "-T ifunc-static.ld" "" "" {ifunc-17.s}
888 {{objdump -d ifunc-17.dd}
889 {objdump {-s -j.data -j.got} ifunc-17.gd}
890 {readelf -r ifunc-17.rd}}
891 "ifunc-17"}
892 {"Long PLT entries in executables" "--long-plt -shared --section-start=.plt=0x1000 --section-start=.got=0xf0001100" ""
893 "" {long-plt-format.s}
894 {{objdump "-d -j .plt" long-plt-format.d}}
895 "long-plt-format"}
896 {"IFUNC and TLS descriptor shared library" "-shared -T arm-lib.ld --version-script=ifunc-gdesc.ver" "" "" {ifunc-gdesc.s}
897 {{objdump "-Rw" ifunc-gdesc.r}}
898 "ifunc-gdesc.so"}
899 {"arm-pic-veneer" "-static -T arm.ld --pic-veneer" "" "" {arm-pic-veneer.s}
900 {{objdump -d arm-pic-veneer.d}}
901 "arm-pic-veneer"}
902 {"Preempt Thumb symbol" "tmpdir/mixed-lib.so -T arm-dyn.ld --use-blx" "" ""
903 {preempt-app.s}
904 {{readelf -Ds preempt-app.sym}}
905 "preempt-app"}
906 }
907
908 # Massage the $armeabitests_common list into run_ld_link_tests standard form.
909 # See the comment before 'set armeabitests_common', above.
910 set elide_action_elt 3
911 set is_nacl [istarget "arm*-*-nacl*"]
912 if {$is_nacl} {
913 set elide_action_elt 2
914 }
915 set neabi_common [llength $armeabitests_common]
916 for {set i 0} {$i < $neabi_common} {incr i} {
917 set case [lindex $armeabitests_common $i]
918 set actions [lindex $case 5]
919 set nactions [llength $actions]
920 for {set j 0} {$j < $nactions} {incr j} {
921 set action [lindex $actions $j]
922 if {[llength $action] == 4} {
923 set action [lreplace $action $elide_action_elt $elide_action_elt]
924 lset armeabitests_common $i 5 $j $action
925 }
926 }
927 }
928
929 run_ld_link_tests $armeabitests_common
930 if { !$is_nacl } {
931 run_ld_link_tests $armeabitests_nonacl
932 }
933
934 run_dump_test "attr-merge-div-00"
935 run_dump_test "attr-merge-div-01"
936 run_dump_test "attr-merge-div-10"
937 run_dump_test "attr-merge-div-01-m3"
938 run_dump_test "attr-merge-div-10-m3"
939 run_dump_test "attr-merge-div-11"
940 run_dump_test "attr-merge-div-12"
941 run_dump_test "attr-merge-div-120"
942 run_dump_test "attr-merge-div-21"
943 run_dump_test "attr-merge-div-22"
944 run_dump_test "attr-merge-div-02"
945 run_dump_test "attr-merge-div-20"
946 run_dump_test "attr-merge-wchar-00"
947 run_dump_test "attr-merge-wchar-02"
948 run_dump_test "attr-merge-wchar-04"
949 run_dump_test "attr-merge-wchar-20"
950 run_dump_test "attr-merge-wchar-22"
951 run_dump_test "attr-merge-wchar-24"
952 run_dump_test "attr-merge-wchar-40"
953 run_dump_test "attr-merge-wchar-42"
954 run_dump_test "attr-merge-wchar-44"
955 run_dump_test "attr-merge-wchar-00-nowarn"
956 run_dump_test "attr-merge-wchar-02-nowarn"
957 run_dump_test "attr-merge-wchar-04-nowarn"
958 run_dump_test "attr-merge-wchar-20-nowarn"
959 run_dump_test "attr-merge-wchar-22-nowarn"
960 run_dump_test "attr-merge-wchar-24-nowarn"
961 run_dump_test "attr-merge-wchar-40-nowarn"
962 run_dump_test "attr-merge-wchar-42-nowarn"
963 run_dump_test "attr-merge-wchar-44-nowarn"
964 run_dump_test "farcall-section"
965 run_dump_test "attr-merge-unknown-1"
966 run_dump_test "attr-merge-unknown-2"
967 run_dump_test "attr-merge-unknown-2r"
968 run_dump_test "attr-merge-unknown-3"
969 run_dump_test "unwind-1"
970 run_dump_test "unwind-2"
971 run_dump_test "unwind-3"
972 run_dump_test "unwind-4"
973 run_dump_test "unwind-5"
974 run_dump_test "attr-merge-vfp-1"
975 run_dump_test "attr-merge-vfp-1r"
976 run_dump_test "attr-merge-vfp-2"
977 run_dump_test "attr-merge-vfp-2r"
978 run_dump_test "attr-merge-vfp-3"
979 run_dump_test "attr-merge-vfp-3r"
980 run_dump_test "attr-merge-vfp-4"
981 run_dump_test "attr-merge-vfp-4r"
982 run_dump_test "attr-merge-vfp-5"
983 run_dump_test "attr-merge-vfp-5r"
984 run_dump_test "attr-merge-vfp-6"
985 run_dump_test "attr-merge-vfp-6r"
986 run_dump_test "attr-merge-vfp-7"
987 run_dump_test "attr-merge-vfp-7r"
988 run_dump_test "attr-merge-vfp-8"
989 run_dump_test "attr-merge-vfp-8r"
990 run_dump_test "attr-merge-vfp-9"
991 run_dump_test "attr-merge-vfp-9r"
992 run_dump_test "attr-merge-vfp-10"
993 run_dump_test "attr-merge-vfp-10r"
994 run_dump_test "attr-merge-vfp-11"
995 run_dump_test "attr-merge-vfp-11r"
996 run_dump_test "attr-merge-vfp-12"
997 run_dump_test "attr-merge-vfp-12r"
998 run_dump_test "attr-merge-vfp-13"
999 run_dump_test "attr-merge-vfp-13r"
1000 run_dump_test "attr-merge-vfp-14"
1001 run_dump_test "attr-merge-vfp-14r"
1002 run_dump_test "attr-merge-incompatible"
1003 run_dump_test "attr-merge-arch-2"
1004 run_dump_test "attr-merge-nosection-1"
1005 run_dump_test "attr-merge-hardfp-use-1"
1006 run_dump_test "attr-merge-hardfp-use-2"
1007 run_dump_test "unresolved-1"
1008 if { ![istarget "arm*-*-nacl*"] } {
1009 run_dump_test "unresolved-1-dyn"
1010 }
1011 run_dump_test "unresolved-2"
1012 run_dump_test "gc-hidden-1"
1013 run_dump_test "protected-data"
1014 run_dump_test "stm32l4xx-cannot-fix-it-block"
1015 run_dump_test "stm32l4xx-cannot-fix-far-ldm"
1016 set arm_unwind_tests {
1017 {"unwind-rel" "-r -Tarm.ld" "" "" {unwind-rel1.s unwind-rel2.s unwind-rel3.s}
1018 {{readelf -ur unwind-rel.d}}
1019 "unwind-rel"}
1020 {"unwind-mix" "-Tarm.ld" "" "" {unwind-mix1.s unwind-mix2.s}
1021 {{readelf -u unwind-mix.d}}
1022 "unwind-mix"}
1023 }
1024 run_ld_link_tests $arm_unwind_tests