]>
Commit | Line | Data |
---|---|---|
28ad2e2d ME |
1 | # Relocation test. |
2 | ||
3 | proc ld_test { objects ldflags dest test } { | |
4 | set ld_output [target_link $objects $dest $ldflags] | |
5 | if [string match "" $ld_output] then { pass $test } else { fail $test } | |
6 | } | |
7 | ||
8 | proc objdump_test { exec flags dest test } { | |
9 | set objcopy [find_binutils_prog objdump] | |
10 | verbose -log "$objcopy $flags $exec > $dest" | |
11 | catch "exec $objcopy $flags $exec > $dest" objdump_output | |
12 | if [string match "" $objdump_output] then { pass $test } else { fail $test } | |
13 | } | |
14 | ||
15 | proc regexp_test { file1 file2 test } { | |
16 | if [regexp_diff $file1 $file2] then { fail $test } else { pass $test } | |
17 | } | |
18 | ||
19 | ||
20 | global srcdir subdir | |
21 | if [istarget microblaze*-*-*] { | |
22 | gas_test "reloc_strongsym.s" {-o reloc_strongsym.o} {} {assembling reloc_strongsym} | |
23 | gas_test "reloc_weaksym.s" {-o reloc_weaksym.o} {} {assembling reloc_weaksym} | |
24 | ld_test {reloc_strongsym.o reloc_weaksym.o} {-e 0 -section-start .text=0x10000054 -section-start .testsection=0x4} {reloc_sym.x} {linking reloc_sym.x} | |
25 | objdump_test {reloc_sym.x} {-d --section=.text --section=.testsection} {reloc_sym.dump} {disassembling reloc_sym.x} | |
26 | regexp_test {reloc_sym.dump} "$srcdir/$subdir/reloc_sym.d" {matching disassembly} | |
27 | } |