OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [ld/] [testsuite/] [ld-arm/] [arm-elf.exp] - Blame information for rev 33

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 33 khays
# Expect script for various ARM ELF tests.
2
#   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
3
#   Free Software Foundation, Inc.
4
#
5
# This file is part of the GNU Binutils.
6
#
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20
# MA 02110-1301, USA.
21
#
22
 
23
if {[istarget "arm-*-vxworks"]} {
24
    set armvxworkstests {
25
        {"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
26
         "" {vxworks1-lib.s}
27
         {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
28
          {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}}
29
         "libvxworks1.so"}
30
        {"VxWorks executable test 1 (dynamic)" \
31
         "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
32
         "" {vxworks1.s}
33
         {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
34
         "vxworks1"}
35
        {"VxWorks executable test 2 (dynamic)" \
36
         "-Tvxworks1.ld -q --force-dynamic"
37
         "" {vxworks2.s}
38
         {{readelf --segments vxworks2.sd}}
39
         "vxworks2"}
40
        {"VxWorks executable test 2 (static)"
41
         "-Tvxworks1.ld"
42
         "" {vxworks2.s}
43
         {{readelf --segments vxworks2-static.sd}}
44
         "vxworks2"}
45
    }
46
    run_ld_link_tests $armvxworkstests
47
    run_dump_test "vxworks1-static"
48
    run_dump_test "emit-relocs1-vxworks"
49
}
50
 
51
if { [istarget "arm*-*-symbianelf*"] } {
52
    run_dump_test "symbian-seg1"
53
}
54
 
55
# Exclude non-ARM-ELF targets.
56
 
57
if { ![is_elf_format] || ![istarget "arm*-*-*"] } {
58
    return
59
}
60
 
61
# List contains test-items with 3 items followed by 2 lists and one more item:
62
# 0:name 1:ld options 2:assembler options
63
# 3:filenames of assembler files 4: action and options. 5: name of output file
64
 
65
# Actions:
66
# objdump: Apply objdump options on result.  Compare with regex (last arg).
67
# nm: Apply nm options on result.  Compare with regex (last arg).
68
# readelf: Apply readelf options on result.  Compare with regex (last arg).
69
 
70
set armelftests {
71
    {"Group relocations" "-Ttext 0x8000 --section-start zero=0x0 --section-start alpha=0xeef0 --section-start beta=0xffeef0" "" {group-relocs.s}
72
     {{objdump -dr group-relocs.d}}
73
     "group-relocs"}
74
    {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" {thumb1-bl.s}
75
     {{objdump -dr thumb1-bl.d}}
76
     "thumb1-bl"}
77
    {"Simple non-PIC shared library" "-shared" "" {arm-lib.s}
78
     {{objdump -fdw arm-lib.d} {objdump -Rw arm-lib.r}}
79
     "arm-lib.so"}
80
    {"Simple PIC shared library" "-shared" "" {arm-lib-plt32.s}
81
     {{objdump -fdw arm-lib-plt32.d} {objdump -Rw arm-lib-plt32.r}}
82
     "arm-lib-plt32.so"}
83
    {"Indirect cross-library function reference (set-up)"
84
     "-shared" "" {arm-lib-plt-2a.s}
85
     {}
86
     "arm-lib-plt-2a.so"}
87
    {"Indirect cross-library function reference"
88
     "-shared tmpdir/arm-lib-plt-2a.so" "" {arm-lib-plt-2b.s}
89
     {{objdump -dr arm-lib-plt-2.dd} {readelf --relocs arm-lib-plt-2.rd}}
90
     "arm-lib-plt-2b.so"}
91
    {"Simple dynamic application" "tmpdir/arm-lib.so" "" {arm-app.s}
92
     {{objdump -fdw arm-app.d} {objdump -Rw arm-app.r}}
93
     "arm-app"}
94
    {"Simple static application" "" "" {arm-static-app.s}
95
     {{objdump -fdw arm-static-app.d} {objdump -rw arm-static-app.r}}
96
     "arm-static-app"}
97
    {"Non-pcrel function reference" "tmpdir/arm-lib.so" "" {arm-app-abs32.s}
98
     {{objdump -fdw arm-app-abs32.d} {objdump -Rw arm-app-abs32.r}}
99
     "arm-app-abs32"}
100
    {"Thumb shared library with ARM entry points" "-shared -T arm-lib.ld" "-mthumb-interwork"
101
     {mixed-lib.s}
102
     {{objdump -fdw armthumb-lib.d} {readelf -Ds armthumb-lib.sym}}
103
     "armthumb-lib.so"}
104
    {"Mixed ARM/Thumb shared library" "-shared -T arm-lib.ld -use-blx" ""
105
     {mixed-lib.s}
106
     {{objdump -fdw mixed-lib.d} {objdump -Rw mixed-lib.r}
107
      {readelf -Ds mixed-lib.sym}}
108
     "mixed-lib.so"}
109
    {"Mixed ARM/Thumb dynamic application" "tmpdir/mixed-lib.so -T arm-dyn.ld" ""
110
     {mixed-app.s}
111
     {{objdump -fdw mixed-app.d} {objdump -Rw mixed-app.r}
112
      {readelf -Ds mixed-app.sym}}
113
     "mixed-app"}
114
    {"Mixed ARM/Thumb arch5 dynamic application" "tmpdir/mixed-lib.so -T arm-dyn.ld --use-blx" ""
115
     {mixed-app.s}
116
     {{objdump -fdw mixed-app-v5.d} {objdump -Rw mixed-app.r}
117
      {readelf -Ds mixed-app.sym}}
118
     "mixed-app-v5"}
119
    {"target1-abs" "-static --target1-abs -T arm.ld" "" {arm-target1.s}
120
     {{objdump -s arm-target1-abs.d}}
121
     "arm-target1-abs"}
122
    {"target1-rel" "-static --target1-rel -T arm.ld" "" {arm-target1.s}
123
     {{objdump -s arm-target1-rel.d}}
124
     "arm-target1-rel"}
125
    {"target2-rel" "-static --target2=rel -T arm.ld" "" {arm-target2.s}
126
     {{objdump -s arm-target2-rel.d}}
127
     "arm-target2-rel"}
128
    {"target2-abs" "-static --target2=abs -T arm.ld" "" {arm-target2.s}
129
     {{objdump -s arm-target2-abs.d}}
130
     "arm-target2-abs"}
131
    {"target2-got-rel" "-static --target2=got-rel -T arm.ld" "" {arm-target2.s}
132
     {{objdump -s arm-target2-got-rel.d}}
133
     "arm-target2-got-rel"}
134
    {"arm-rel31" "-static -T arm.ld" "" {arm-rel31.s}
135
     {{objdump -s arm-rel31.d}}
136
     "arm-rel31"}
137
    {"arm-rel32" "-shared -T arm-dyn.ld" "" {arm-rel32.s}
138
     {{objdump -Rsj.data arm-rel32.d}}
139
     "arm-rel32"}
140
    {"arm-call" "-static -T arm.ld" "-meabi=4" {arm-call1.s arm-call2.s}
141
     {{objdump -d arm-call.d}}
142
     "arm-call"}
143
    {"TLS shared library" "-shared -T arm-lib.ld" "" {tls-lib.s}
144
     {{objdump -fdw tls-lib.d} {objdump -Rw tls-lib.r}}
145
     "tls-lib.so"}
146
    {"TLS dynamic application" "-T arm-dyn.ld tmpdir/tls-lib.so" "" {tls-app.s}
147
     {{objdump -fdw tls-app.d} {objdump -Rw tls-app.r}}
148
     "tls-app"}
149
    {"TLS gnu shared library got" "-shared -T arm-dyn.ld" "" {tls-gdesc-got.s}
150
     {{objdump "-fDR -j .got" tls-gdesc-got.d}}
151
     "tls-lib2-got.so"}
152
    {"TLS gnu shared library inlined trampoline" "-shared -T arm-dyn.ld" "" {tls-descseq.s}
153
     {{objdump -fdw tls-descseq.d} {objdump -Rw tls-descseq.r}}
154
     "tls-lib2inline.so"}
155
    {"TLS shared library gdesc local" "-shared -T arm-dyn.ld" "" {tls-lib-loc.s}
156
     {{objdump -fdw tls-lib-loc.d} {objdump -Rw tls-lib-loc.r}}
157
     "tls-lib-loc.so"}
158
    {"TLS gnu GD to IE relaxation" "-static -T arm-dyn.ld" "" {tls-gdierelax.s}
159
     {{objdump -fdw tls-gdierelax.d}}
160
     "tls-app-rel-ie"}
161
    {"TLS gnu GD to IE shared relaxation" "-shared -T arm-dyn.ld" "" {tls-gdierelax2.s}
162
     {{objdump -fdw tls-gdierelax2.d}}
163
     "tls-app-rel-ie2"}
164
    {"TLS gnu GD to LE relaxation" "-T arm-dyn.ld" "" {tls-gdlerelax.s}
165
     {{objdump -fdw tls-gdlerelax.d}}
166
     "tls-app-rel-le"}
167
    {"TLS mixed models shared lib" "-shared -T arm-dyn.ld" "" {tls-mixed.s}
168
     {{objdump -Rw tls-mixed.r}}
169
     "tls-mixed.so"}
170
    {"TLS descseq relaxation" "-T arm-dyn.ld" "" {tls-descrelax.s}
171
     {{objdump -fdw tls-descrelax.d}}
172
     "tls-descrelax"}
173
    {"TLS descseq relaxation v7" "-T arm-dyn.ld" "" {tls-descrelax-v7.s}
174
     {{objdump -fdw tls-descrelax-v7.d}}
175
     "tls-descrelax-v7"}
176
    {"TLS descseq relaxation BE8" "-T arm-dyn.ld -EB --be8" "-mbig-endian" {tls-descrelax-be8.s}
177
     {{objdump -fdw tls-descrelax-be8.d}}
178
     "tls-descrelax-be8"}
179
    {"TLS descseq relaxation BE32" "-T arm-dyn.ld -EB" "-mbig-endian" {tls-descrelax-be32.s}
180
     {{objdump -fdw tls-descrelax-be32.d}}
181
     "tls-descrelax-be32"}
182
    {"Thumb entry point" "-T arm.ld" "" {thumb-entry.s}
183
     {{readelf -h thumb-entry.d}}
184
     "thumb-entry"}
185
    {"thumb-rel32" "-static -T arm.ld" "" {thumb-rel32.s}
186
     {{objdump -s thumb-rel32.d}}
187
     "thumb-rel32"}
188
    {"MOVW/MOVT" "-static -T arm.ld" "" {arm-movwt.s}
189
     {{objdump -dw arm-movwt.d}}
190
     "arm-movwt"}
191
    {"BE8 Mapping Symbols" "-static -T arm.ld -EB --be8" "-EB" {arm-be8.s}
192
     {{objdump -d arm-be8.d}}
193
     "arm-be8"}
194
    {"Using Thumb lib by another lib" "-shared tmpdir/mixed-lib.so" "" {use-thumb-lib.s}
195
     {{readelf -Ds use-thumb-lib.sym}}
196
     "use-thumb-lib.so"}
197
    {"VFP11 denorm erratum fix, scalar operation"
198
     "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "-EL -mfpu=vfpxd" {vfp11-fix-scalar.s}
199
     {{objdump -dr vfp11-fix-scalar.d}}
200
     "vfp11-fix-scalar"}
201
    {"VFP11 denorm erratum fix, vector operation"
202
     "-EB --vfp11-denorm-fix=vector -Ttext=0x8000" "-EB -mfpu=vfpxd" {vfp11-fix-vector.s}
203
     {{objdump -dr vfp11-fix-vector.d}}
204
     "vfp11-fix-vector"}
205
    {"VFP11 denorm erratum fix, embedded code-like data"
206
     "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "-EL -mfpu=vfpxd" {vfp11-fix-none.s}
207
     {{objdump -dr vfp11-fix-none.d}}
208
     "vfp11-fix-none"}
209
    {"Cortex-A8 erratum fix, b.w"
210
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-b.s}
211
     {{objdump -dr cortex-a8-fix-b.d}}
212
     "cortex-a8-fix-b"}
213
    {"Cortex-A8 erratum fix, b.w to PLT"
214
     "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "-EL"
215
     {cortex-a8-fix-b-plt.s}
216
     {{objdump -dr cortex-a8-fix-b-plt.d}}
217
     "cortex-a8-fix-b-plt"}
218
    {"Cortex-A8 erratum fix, bl.w"
219
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bl.s}
220
     {{objdump -dr cortex-a8-fix-bl.d}}
221
     "cortex-a8-fix-bl"}
222
    {"Cortex-A8 erratum fix, bl.w to PLT"
223
     "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "-EL"
224
     {cortex-a8-fix-bl-plt.s}
225
     {{objdump -dr cortex-a8-fix-bl-plt.d}}
226
     "cortex-a8-fix-bl-plt"}
227
    {"Cortex-A8 erratum fix, bcc.w"
228
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bcc.s}
229
     {{objdump -dr cortex-a8-fix-bcc.d}}
230
     "cortex-a8-fix-bcc"}
231
    {"Cortex-A8 erratum fix, bcc.w to PLT"
232
     "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "-EL"
233
     {cortex-a8-fix-bcc-plt.s}
234
     {{objdump -dr cortex-a8-fix-bcc-plt.d}}
235
     "cortex-a8-fix-bcc-plt"}
236
    {"Cortex-A8 erratum fix, blx.w"
237
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx.s}
238
     {{objdump -dr cortex-a8-fix-blx.d}}
239
     "cortex-a8-fix-blx"}
240
    {"Cortex-A8 erratum fix, blx.w to PLT"
241
     "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "-EL"
242
     {cortex-a8-fix-blx-plt.s}
243
     {{objdump -dr cortex-a8-fix-blx-plt.d}}
244
     "cortex-a8-fix-blx-plt"}
245
    {"Cortex-A8 erratum fix, relocate b.w to ARM"
246
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s}
247
     {{objdump -dr cortex-a8-fix-b-rel-arm.d}}
248
     "cortex-a8-fix-b-rel-arm"}
249
    {"Cortex-A8 erratum fix, relocate b.w to Thumb"
250
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s}
251
     {{objdump -dr cortex-a8-fix-b-rel-thumb.d}}
252
     "cortex-a8-fix-b-rel-thumb"}
253
    {"Cortex-A8 erratum fix, relocate bl.w to ARM"
254
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s}
255
     {{objdump -dr cortex-a8-fix-bl-rel-arm.d}}
256
     "cortex-a8-fix-bl-rel-arm"}
257
    {"Cortex-A8 erratum fix, relocate bl.w to Thumb"
258
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
259
     {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}}
260
     "cortex-a8-fix-bl-rel-thumb"}
261
    {"Cortex-A8 erratum fix, relocate bl.w to PLT"
262
     "-EL --section-start=.plt=0x8e00 -Ttext=0x8f00 --fix-cortex-a8 -shared"
263
     "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
264
     {{objdump -dr cortex-a8-fix-bl-rel-plt.d}}
265
     "cortex-a8-fix-bl-rel-thumb"}
266
    {"Cortex-A8 erratum fix, relocate b.w to Thumb"
267
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s}
268
     {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}}
269
     "cortex-a8-fix-bcc-rel-thumb"}
270
    {"Cortex-A8 erratum fix, relocate blx.w to ARM"
271
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s}
272
     {{objdump -dr cortex-a8-fix-blx-rel-arm.d}}
273
     "cortex-a8-fix-blx-rel-arm"}
274
    {"Cortex-A8 erratum fix, relocate blx.w to Thumb"
275
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s}
276
     {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}}
277
     "cortex-a8-fix-blx-rel-thumb"}
278
    {"Cortex-A8 erratum fix, relocate bl.w and far call"
279
     "-EL -Ttext=0x00 --fix-cortex-a8 --defsym _start=0"
280
     "-EL -mcpu=cortex-a8" {cortex-a8-far-1.s cortex-a8-far-2.s cortex-a8-far-3.s}
281
     {{objdump -dr cortex-a8-far.d}}
282
     "cortex-a8-far"}
283
    {"Cortex-A8 erratum fix, headers"
284
     "-EL --fix-cortex-a8 -T cortex-a8-fix-hdr.t"
285
     "-EL -mcpu=cortex-a8" {cortex-a8-fix-hdr.s}
286
     {{objdump -dr cortex-a8-fix-hdr.d}}
287
     "cortex-a8-fix-hdr"}
288
    {"Cortex-A8 erratum fix, blx.w and b.w together"
289
     "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx-bcond.s}
290
     {{objdump -dr cortex-a8-fix-blx-bcond.d}}
291
     "cortex-a8-fix-blx-bcond"}
292
    {"Unwinding and -gc-sections" "-gc-sections" "" {gc-unwind.s}
293
     {{objdump -sj.data gc-unwind.d}}
294
     "gc-unwind"}
295
    {"Thumb and -gc-sections" "-shared -T arm-dyn.ld" "" {gc-thumb-lib.s}
296
     {}
297
     "gc-thumb-lib.so"}
298
    {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" {gc-thumb.s}
299
     {{readelf --relocs gc-thumb.d}}
300
     "gc-thumb"}
301
    {"arm-pic-veneer" "-static -T arm.ld --pic-veneer" "" {arm-pic-veneer.s}
302
     {{objdump -d arm-pic-veneer.d}}
303
     "arm-pic-veneer"}
304
    {"Preempt Thumb symbol" "tmpdir/mixed-lib.so -T arm-dyn.ld --use-blx" ""
305
     {preempt-app.s}
306
     {{readelf -Ds preempt-app.sym}}
307
     "preempt-app"}
308
    {"jump19" "-static -T arm.ld" "" {jump19.s}
309
     {{objdump -dr jump19.d}}
310
     "jump19"}
311
    {"script-type" "-static -T script-type.ld" "" {script-type.s}
312
     {{readelf -s script-type.sym}}
313
     "script-type"}
314
    {"callweak" "-static -T arm.ld" "" {callweak.s}
315
     {{objdump -dr callweak.d}}
316
     "callweak"}
317
    {"callweak-2" "-static -T arm.ld" "" {callweak-2.s}
318
     {{objdump -dr callweak-2.d}}
319
     "callweak-2"}
320
    {"Relocation boundaries" "-defsym x=0 -defsym y=0 -defsym _start=0" "" {reloc-boundaries.s}
321
     {{objdump -s reloc-boundaries.d}}
322
     "reloc-boundaries"}
323
    {"Data only mapping symbols" "-T data-only-map.ld -Map map" "" {data-only-map.s}
324
     {{objdump -dr data-only-map.d}}
325
     "data-only-map"}
326
    {"GOT relocations in executables (setup)" "-shared"
327
     "" {exec-got-1a.s}
328
     {}
329
     "exec-got-1.so"}
330
    {"GOT relocations in executables" "tmpdir/exec-got-1.so"
331
     "" {exec-got-1b.s}
332
     {{readelf --relocs exec-got-1.d}}
333
     "exec-got-1"}
334
    {"IFUNC test 1" "-T ifunc-static.ld" "" {ifunc-1.s}
335
     {{objdump -d ifunc-1.dd}
336
      {objdump {-s -j.data -j.got} ifunc-1.gd}
337
      {readelf -dr ifunc-1.rd}}
338
     "ifunc-1"}
339
    {"IFUNC test 2" "-T ifunc-static.ld" "" {ifunc-2.s}
340
     {{objdump -d ifunc-2.dd}
341
      {objdump {-s -j.data -j.got} ifunc-2.gd}
342
      {readelf -dr ifunc-2.rd}}
343
     "ifunc-2"}
344
    {"IFUNC test 3" "-T ifunc-dynamic.ld -shared" "" {ifunc-3.s}
345
     {{objdump -d ifunc-3.dd}
346
      {objdump {-s -j.data -j.got} ifunc-3.gd}
347
      {readelf -r ifunc-3.rd}}
348
     "ifunc-3.so"}
349
    {"IFUNC test 4" "-T ifunc-dynamic.ld -shared" "" {ifunc-4.s}
350
     {{objdump -d ifunc-4.dd}
351
      {objdump {-s -j.data -j.got} ifunc-4.gd}
352
      {readelf -r ifunc-4.rd}}
353
     "ifunc-4.so"}
354
    {"IFUNC test 5" "-T ifunc-static.ld" "" {ifunc-5.s}
355
     {{objdump -d ifunc-5.dd}
356
      {objdump {-s -j.data -j.got} ifunc-5.gd}
357
      {readelf -dr ifunc-5.rd}}
358
     "ifunc-5"}
359
    {"IFUNC test 6" "-T ifunc-static.ld" "" {ifunc-6.s}
360
     {{objdump -d ifunc-6.dd}
361
      {objdump {-s -j.data -j.got} ifunc-6.gd}
362
      {readelf -dr ifunc-6.rd}}
363
     "ifunc-6"}
364
    {"IFUNC test 7" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so -shared"
365
     "" {ifunc-7.s}
366
     {{objdump -d ifunc-7.dd}
367
      {objdump {-s -j.data -j.got} ifunc-7.gd}
368
      {readelf -r ifunc-7.rd}}
369
     "ifunc-7.so"}
370
    {"IFUNC test 8" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so -shared"
371
     "" {ifunc-8.s}
372
     {{objdump -d ifunc-8.dd}
373
      {objdump {-s -j.data -j.got} ifunc-8.gd}
374
      {readelf -r ifunc-8.rd}}
375
     "ifunc-8.so"}
376
    {"IFUNC test 9" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so" "" {ifunc-9.s}
377
     {{objdump -d ifunc-9.dd}
378
      {objdump {-s -j.data -j.got} ifunc-9.gd}
379
      {readelf -r ifunc-9.rd}}
380
     "ifunc-9"}
381
    {"IFUNC test 10" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so" "" {ifunc-10.s}
382
     {{objdump -d ifunc-10.dd}
383
      {objdump {-s -j.data -j.got} ifunc-10.gd}
384
      {readelf -r ifunc-10.rd}}
385
     "ifunc-10"}
386
    {"IFUNC test 11" "-T ifunc-static.ld" "" {ifunc-11.s}
387
     {{objdump -d ifunc-11.dd}
388
      {objdump {-s -j.data -j.got} ifunc-11.gd}
389
      {readelf -dr ifunc-11.rd}}
390
     "ifunc-11"}
391
    {"IFUNC test 12" "-T ifunc-dynamic.ld -shared" "" {ifunc-12.s}
392
     {{objdump -d ifunc-12.dd}
393
      {objdump {-s -j.data -j.got} ifunc-12.gd}
394
      {readelf -r ifunc-12.rd}}
395
     "ifunc-12.so"}
396
    {"IFUNC test 13" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-13.s}
397
     {{objdump -d ifunc-13.dd}
398
      {objdump {-s -j.data -j.got} ifunc-13.gd}
399
      {readelf -r ifunc-13.rd}}
400
     "ifunc-13"}
401
    {"IFUNC test 14" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-14.s}
402
     {{objdump -d ifunc-14.dd}
403
      {objdump {-s -j.data -j.got} ifunc-14.gd}
404
      {readelf -r ifunc-14.rd}}
405
     "ifunc-14"}
406
    {"IFUNC test 15" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-15.s}
407
     {{objdump -d ifunc-15.dd}
408
      {objdump {-s -j.data -j.got} ifunc-15.gd}
409
      {readelf -r ifunc-15.rd}}
410
     "ifunc-15"}
411
    {"IFUNC test 16" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" {ifunc-16.s}
412
     {{objdump -d ifunc-16.dd}
413
      {objdump {-s -j.data -j.got} ifunc-16.gd}
414
      {readelf -r ifunc-16.rd}}
415
     "ifunc-16"}
416
    {"abs call" "-T arm.ld" "" {abs-call-1.s}
417
     {{objdump -d abs-call-1.d}}
418
     "abs-call-1"}
419
}
420
 
421
run_ld_link_tests $armelftests
422
run_dump_test "group-relocs-alu-bad"
423
run_dump_test "group-relocs-ldr-bad"
424
run_dump_test "group-relocs-ldrs-bad"
425
run_dump_test "group-relocs-ldc-bad"
426
run_dump_test "thumb2-bl-undefweak"
427
run_dump_test "thumb2-bl-undefweak1"
428
run_dump_test "emit-relocs1"
429
run_dump_test "movw-shared-1"
430
run_dump_test "movw-shared-2"
431
run_dump_test "movw-shared-3"
432
run_dump_test "movw-shared-4"
433
 
434
# Exclude non-ARM-EABI targets.
435
 
436
if { ![istarget "arm*-*-*eabi"] } {
437
    # Special variants of these tests, as a different farcall stub is
438
    # generated for a non-ARM-EABI target: indeed in such a case,
439
    # there are no attributes to indicate that blx can be used.
440
 
441
    set arm_noeabi_tests {
442
        {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-as-thumb1-bad.s}
443
            {{objdump -d thumb2-bl-as-thumb1-bad-noeabi.d}}
444
            "thumb2-bl-as-thumb1-bad"}
445
        {"Thumb-2 BL bad" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-bad.s}
446
            {{objdump -d thumb2-bl-bad-noeabi.d}}
447
            "thumb2-bl-bad"}
448
    }
449
    run_ld_link_tests $arm_noeabi_tests
450
 
451
    return
452
}
453
 
454
# Farcalls stubs are fully supported for ARM-EABI only
455
set armeabitests {
456
     {"EABI attribute merging" "-r" "" {attr-merge.s attr-merge.s}
457
      {{readelf -A attr-merge.attr}}
458
      "attr-merge"}
459
     {"EABI attribute merging 2" "-r" "" {attr-merge-2a.s attr-merge-2b.s}
460
      {{readelf -A attr-merge-2.attr}}
461
      "attr-merge-2"}
462
     {"EABI attribute merging 3" "-r" "" {attr-merge-3a.s attr-merge-3b.s}
463
      {{readelf -A attr-merge-3.attr}}
464
      "attr-merge-3"}
465
     {"EABI attribute merging 4" "-r" "" {attr-merge-4a.s attr-merge-4b.s}
466
      {{readelf -A attr-merge-4.attr}}
467
      "attr-merge-4"}
468
     {"EABI attribute merging 5" "-r" "" {attr-merge-5.s attr-merge-5.s}
469
      {{readelf -A attr-merge-5.attr}}
470
      "attr-merge-5"}
471
     {"EABI attribute merging 6" "-r" "" {attr-merge-6a.s attr-merge-6b.s}
472
      {{readelf -A attr-merge-6.attr}}
473
      "attr-merge-6"}
474
     {"EABI attribute merging 6 reversed" "-r" "" {attr-merge-6b.s attr-merge-6a.s}
475
      {{readelf -A attr-merge-6.attr}}
476
      "attr-merge-6r"}
477
     {"EABI attribute merging 7" "-r" "" {attr-merge-7a.s attr-merge-7b.s}
478
      {{readelf -A attr-merge-7.attr}}
479
      "attr-merge-7"}
480
     {"EABI attribute arch merging 1" "-r" "" {arch-v6k.s arch-v6t2.s}
481
      {{readelf -A attr-merge-arch-1.attr}}
482
      "attr-merge-arch-1"}
483
     {"EABI attribute arch merging 1 reversed" "-r" "" {arch-v6t2.s arch-v6k.s}
484
      {{readelf -A attr-merge-arch-1.attr}}
485
      "attr-merge-arch-1r"}
486
     {"EABI attribute arch merging 2" "-r" "" {arch-v6k.s arch-v6.s}
487
      {{readelf -A attr-merge-arch-2.attr}}
488
      "attr-merge-arch-2"}
489
     {"EABI attribute arch merging 2 reversed" "-r" "" {arch-v6.s arch-v6k.s}
490
      {{readelf -A attr-merge-arch-2.attr}}
491
      "attr-merge-arch-2r"}
492
     {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" {thumb2-bl.s}
493
      {{objdump -dr thumb2-bl.d}}
494
      "thumb2-bl"}
495
     {"Thumb-2 Interworked branch" "-T arm.ld" "" {thumb2-b-interwork.s}
496
      {{objdump -dr thumb2-b-interwork.d}}
497
      "thumb2-b-interwork"}
498
    {"BL/BLX interworking" "-T arm.ld" "" {thumb2-bl-blx-interwork.s}
499
     {{objdump -dr thumb2-bl-blx-interwork.d}}
500
     "thumb2-bl-blx-interwork"}
501
    {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s}
502
     {{objdump -d armv4-bx.d}}
503
     "armv4-bx"}
504
    {"MOVW/MOVT and merged sections" "-T arm.ld" "" {movw-merge.s}
505
     {{objdump -dw movw-merge.d}}
506
     "movw-merge"}
507
    {"MOVW/MOVT against shared libraries" "tmpdir/arm-lib.so" "" {arm-app-movw.s}
508
     {{objdump -Rw arm-app.r}}
509
     "arm-app-movw"}
510
    {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-as-thumb1-bad.s}
511
     {{objdump -d thumb2-bl-as-thumb1-bad.d}}
512
     "thumb2-bl-as-thumb1-bad"}
513
    {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-bad.s}
514
     {{objdump -d thumb2-bl-bad.d}}
515
     "thumb2-bl-bad"}
516
 
517
    {"ARM-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" {farcall-arm-arm.s}
518
     {{objdump -d farcall-arm-arm.d}}
519
     "farcall-arm-arm"}
520
    {"ARM-ARM farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001020 --pic-veneer" "" {farcall-arm-arm.s}
521
     {{objdump -d farcall-arm-arm-pic-veneer.d}}
522
     "farcall-arm-arm-pic-veneer"}
523
    {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "-EB" {farcall-arm-arm.s}
524
     {{objdump -d farcall-arm-arm.d}}
525
     "farcall-arm-arm-be8"}
526
    {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "-EB" {farcall-arm-arm.s}
527
     {{objdump -d farcall-arm-arm.d}}
528
     "farcall-arm-arm-be"}
529
 
530
    {"ARM-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "" {farcall-arm-thumb.s}
531
     {{objdump -d farcall-arm-thumb.d}}
532
     "farcall-arm-thumb"}
533
    {"ARM-Thumb farcall with BLX" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv5t" {farcall-arm-thumb.s}
534
     {{objdump -d farcall-arm-thumb-blx.d}}
535
     "farcall-arm-thumb-blx"}
536
    {"ARM-Thumb farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "" {farcall-arm-thumb.s}
537
     {{objdump -d farcall-arm-thumb-pic-veneer.d}}
538
     "farcall-arm-thumb-pic-veneer"}
539
    {"ARM-Thumb farcall with BLX (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "-march=armv5t" {farcall-arm-thumb.s}
540
     {{objdump -d farcall-arm-thumb-blx-pic-veneer.d}}
541
     "farcall-arm-thumb-blx-pic-veneer"}
542
 
543
    {"Thumb-Thumb farcall with BLX" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv5t" {farcall-thumb-thumb.s}
544
     {{objdump -d farcall-thumb-thumb-blx.d}}
545
     "farcall-thumb-thumb-blx"}
546
    {"Thumb-Thumb farcall M profile" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv7-m" {farcall-thumb-thumb.s}
547
     {{objdump -d farcall-thumb-thumb-m.d}}
548
     "farcall-thumb-thumb-m"}
549
    {"Thumb-Thumb farcall v6-M" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv6-m" {farcall-thumb-thumb.s}
550
     {{objdump -d farcall-thumb-thumb-m.d}}
551
     "farcall-thumb-thumb-v6-m"}
552
    {"Thumb-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv4t" {farcall-thumb-thumb.s}
553
     {{objdump -d farcall-thumb-thumb.d}}
554
     "farcall-thumb-thumb"}
555
    {"Thumb-Thumb farcall with BLX (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "-march=armv5t" {farcall-thumb-thumb.s}
556
     {{objdump -d farcall-thumb-thumb-blx-pic-veneer.d}}
557
     "farcall-thumb-thumb-blx-pic-veneer"}
558
    {"Thumb-Thumb farcall M profile (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "-march=armv7-m" {farcall-thumb-thumb.s}
559
     {{objdump -d farcall-thumb-thumb-m-pic-veneer.d}}
560
     "farcall-thumb-thumb-m-pic-veneer"}
561
    {"Thumb-Thumb farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "-march=armv4t" {farcall-thumb-thumb.s}
562
     {{objdump -d farcall-thumb-thumb-pic-veneer.d}}
563
     "farcall-thumb-thumb-pic-veneer"}
564
 
565
    {"Thumb-ARM farcall" "-Ttext 0x1c01010 --section-start .foo=0x2001014" "-W" {farcall-thumb-arm.s}
566
     {{objdump -d farcall-thumb-arm.d}}
567
     "farcall-thumb-arm"}
568
    {"Thumb-ARM farcall (BE8)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 -EB --be8" "-W -EB" {farcall-thumb-arm.s}
569
     {{objdump -d farcall-thumb-arm.d}}
570
     "farcall-thumb-arm-be8"}
571
    {"Thumb-ARM farcall (BE)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 -EB" "-W -EB" {farcall-thumb-arm.s}
572
     {{objdump -d farcall-thumb-arm.d}}
573
     "farcall-thumb-arm-be"}
574
    {"Thumb-ARM (short) call" "-Ttext 0x1000 --section-start .foo=0x0002014" "-W" {farcall-thumb-arm-short.s}
575
     {{objdump -d farcall-thumb-arm-short.d}}
576
     "farcall-thumb-arm-short"}
577
    {"Thumb-ARM farcall with BLX" "-Ttext 0x1c01010 --section-start .foo=0x2001014" "-W -march=armv5t" {farcall-thumb-arm.s}
578
     {{objdump -d farcall-thumb-arm-blx.d}}
579
     "farcall-thumb-arm-blx"}
580
    {"Thumb-ARM farcall with BLX (PIC veneer)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 --pic-veneer" "-W -march=armv5t" {farcall-thumb-arm.s}
581
     {{objdump -d farcall-thumb-arm-blx-pic-veneer.d}}
582
     "farcall-thumb-arm-blx-pic-veneer"}
583
    {"Thumb-ARM farcall (PIC veneer)" "-Ttext 0x1c01010 --section-start .foo=0x2001014 --pic-veneer" "-W" {farcall-thumb-arm.s}
584
     {{objdump -d farcall-thumb-arm-pic-veneer.d}}
585
     "farcall-thumb-arm-pic-veneer"}
586
 
587
    {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" {farcall-mix.s}
588
     {{objdump -d farcall-mix.d}}
589
     "farcall-mix"}
590
    {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" {farcall-mix2.s}
591
     {{objdump -d farcall-mix2.d}}
592
     "farcall-mix2"}
593
 
594
    {"Default group size" "-Ttext 0x1000 --section-start .foo=0x2003020" "" {farcall-group.s farcall-group2.s}
595
     {{objdump -d farcall-group.d}}
596
     "farcall-group-default"}
597
    {"Group size=2" "-Ttext 0x1000 --section-start .foo=0x2003020 --stub-group-size=2" "" {farcall-group.s farcall-group2.s}
598
     {{objdump -d farcall-group-size2.d}}
599
     "farcall-group-size2"}
600
    {"Group size limit" "-Ttext 0x1000 --section-start .far=0x2003020" "" {farcall-group3.s farcall-group4.s}
601
     {{objdump -d farcall-group-limit.d}}
602
     "farcall-group-limit"}
603
 
604
    {"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" ""
605
     {farcall-mixed-app.s}
606
     {{objdump -fdw farcall-mixed-app.d} {objdump -Rw farcall-mixed-app.r}
607
      {readelf -Ds farcall-mixed-app.sym}}
608
     "farcall-mixed-app"}
609
    {"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" ""
610
     {farcall-mixed-app.s}
611
     {{objdump -fdw farcall-mixed-app-v5.d} {objdump -Rw farcall-mixed-app.r}
612
      {readelf -Ds farcall-mixed-app.sym}}
613
     "farcall-mixed-app-v5"}
614
 
615
    {"Mixed ARM/Thumb shared library with long branches (v4t)" "-shared -T arm-lib.ld" "-march=armv4t"
616
     {farcall-mixed-lib1.s farcall-mixed-lib2.s}
617
     {{objdump -fdw farcall-mixed-lib-v4t.d}}
618
     "farcall-mixed-lib.so"}
619
 
620
    {"Mixed ARM/Thumb shared library with long branches (v5t)" "-shared -T arm-lib.ld" "-march=armv5t"
621
     {farcall-mixed-lib1.s farcall-mixed-lib2.s}
622
     {{objdump -fdw farcall-mixed-lib.d}}
623
     "farcall-mixed-lib.so"}
624
 
625
    {"Long branch with mixed text and data" "-T arm.ld" "" {farcall-data.s}
626
     {{objdump -dr farcall-data.d}}
627
     "farcall-data"}
628
 
629
    {"R_ARM_THM_JUMP24 Relocation veneers: Short 1"
630
     "--section-start destsect=0x00009000 --section-start .text=0x8000"
631
     "-march=armv7-a -mthumb"
632
     {jump-reloc-veneers.s}
633
     {{objdump -d jump-reloc-veneers-short1.d}}
634
     "jump-reloc-veneers-short1"}
635
    {"R_ARM_THM_JUMP24 Relocation veneers: Short 2"
636
     "--section-start destsect=0x00900000 --section-start .text=0x8000"
637
     "-march=armv7-a -mthumb"
638
     {jump-reloc-veneers.s}
639
     {{objdump -d jump-reloc-veneers-short2.d}}
640
     "jump-reloc-veneers-short2"}
641
    {"R_ARM_THM_JUMP24 Relocation veneers: Long"
642
     "--section-start destsect=0x09000000 --section-start .text=0x8000"
643
     "-march=armv7-a -mthumb"
644
     {jump-reloc-veneers.s}
645
     {{objdump -d jump-reloc-veneers-long.d}}
646
     "jump-reloc-veneers-long"}
647
    {"TLS gnu shared library" "-shared -T arm-dyn.ld" "" {tls-gdesc.s}
648
     {{objdump -fdw tls-gdesc.d} {objdump -Rw tls-gdesc.r}}
649
     "tls-lib2.so"}
650
    {"TLS gnu shared library non-lazy" "-z now -shared -T arm-dyn.ld" "" {tls-gdesc.s}
651
     {{readelf "-x .got" tls-gdesc-nlazy.g}}
652
     "tls-lib2-nlazy.so"}
653
    {"TLS long plt library" "-shared -T arm-dyn.ld --section-start .foo=0x4001000" "" {tls-longplt-lib.s}
654
     {{objdump -fdw tls-longplt-lib.d}}
655
     "tls-longplt-lib.so"}
656
    {"TLS long plt" "-T arm-dyn.ld --section-start .foo=0x4001000 tmpdir/tls-longplt-lib.so" "" {tls-longplt.s}
657
     {{objdump -fdw tls-longplt.d}}
658
     "tls-longplt"}
659
    {"TLS thumb1" "-shared -T arm-dyn.ld --section-start .foo=0x4001000" "" {tls-thumb1.s}
660
     {{objdump -fdw tls-thumb1.d}}
661
     "tls-thumb1"}
662
}
663
 
664
run_ld_link_tests $armeabitests
665
run_dump_test "attr-merge-wchar-00"
666
run_dump_test "attr-merge-wchar-02"
667
run_dump_test "attr-merge-wchar-04"
668
run_dump_test "attr-merge-wchar-20"
669
run_dump_test "attr-merge-wchar-22"
670
run_dump_test "attr-merge-wchar-24"
671
run_dump_test "attr-merge-wchar-40"
672
run_dump_test "attr-merge-wchar-42"
673
run_dump_test "attr-merge-wchar-44"
674
run_dump_test "attr-merge-wchar-00-nowarn"
675
run_dump_test "attr-merge-wchar-02-nowarn"
676
run_dump_test "attr-merge-wchar-04-nowarn"
677
run_dump_test "attr-merge-wchar-20-nowarn"
678
run_dump_test "attr-merge-wchar-22-nowarn"
679
run_dump_test "attr-merge-wchar-24-nowarn"
680
run_dump_test "attr-merge-wchar-40-nowarn"
681
run_dump_test "attr-merge-wchar-42-nowarn"
682
run_dump_test "attr-merge-wchar-44-nowarn"
683
run_dump_test "farcall-section"
684
run_dump_test "attr-merge-unknown-1"
685
run_dump_test "attr-merge-unknown-2"
686
run_dump_test "attr-merge-unknown-2r"
687
run_dump_test "attr-merge-unknown-3"
688
run_dump_test "unwind-1"
689
run_dump_test "unwind-2"
690
run_dump_test "unwind-3"
691
run_dump_test "unwind-4"
692
run_dump_test "unwind-5"
693
run_dump_test "attr-merge-vfp-1"
694
run_dump_test "attr-merge-vfp-1r"
695
run_dump_test "attr-merge-vfp-2"
696
run_dump_test "attr-merge-vfp-2r"
697
run_dump_test "attr-merge-vfp-3"
698
run_dump_test "attr-merge-vfp-3r"
699
run_dump_test "attr-merge-vfp-4"
700
run_dump_test "attr-merge-vfp-4r"
701
run_dump_test "attr-merge-vfp-5"
702
run_dump_test "attr-merge-vfp-5r"
703
run_dump_test "attr-merge-vfp-6"
704
run_dump_test "attr-merge-vfp-6r"
705
run_dump_test "attr-merge-incompatible"
706
run_dump_test "unresolved-1"
707
run_dump_test "unresolved-1-dyn"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.