aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorLulu Cai <cailulu@loongson.cn>2024-12-10 19:42:14 +0800
committercailulu <cailulu@loongson.cn>2024-12-16 15:45:45 +0800
commit1c82e1ee93d57a2013c5acf94558c382e3e2e5c3 (patch)
treee93e72db3483d7cc20cefb0140349aaca0cd7661 /ld
parentb511e48e9b11003cc50aeeac39100af5d2ff18d3 (diff)
downloadbinutils-1c82e1ee93d57a2013c5acf94558c382e3e2e5c3.zip
binutils-1c82e1ee93d57a2013c5acf94558c382e3e2e5c3.tar.gz
binutils-1c82e1ee93d57a2013c5acf94558c382e3e2e5c3.tar.bz2
LoongArch: Fix bfd ld failed test case
This test case requires host gcc, and different distributions have different default configurations for gcc, which can cause address value mismatches. Therefore, it is fixed by passing consistent options and using regular expressions.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-loongarch-elf/call_undefweak.d38
-rw-r--r--ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp2
2 files changed, 15 insertions, 25 deletions
diff --git a/ld/testsuite/ld-loongarch-elf/call_undefweak.d b/ld/testsuite/ld-loongarch-elf/call_undefweak.d
index 4761651..6eedfed 100644
--- a/ld/testsuite/ld-loongarch-elf/call_undefweak.d
+++ b/ld/testsuite/ld-loongarch-elf/call_undefweak.d
@@ -1,26 +1,16 @@
#...
-Disassembly of section \.plt:
-#...
-0+1200004d0 <fn2@plt>:
- 1200004d0: 1c00010f pcaddu12i \$t3, 8
- 1200004d4: 28ed01ef ld.d \$t3, \$t3, -1216
- 1200004d8: 4c0001ed jirl \$t1, \$t3, 0
- 1200004dc: 03400000 nop
-
-Disassembly of section \.text:
-#...
-0+120000668 <main>:
- 120000668: 4c000000 jr \$zero
- 12000066c: 53fe67ff b -412 # 1200004d0 <fn2@plt>
- 120000670: 4c000001 jirl \$ra, \$zero, 0
- 120000674: 57fe5fff bl -420 # 1200004d0 <fn2@plt>
+[0-9a-f]+ <main>:
+ +[0-9a-f]+: 4c000000 jr \$zero
+ +[0-9a-f]+: ........ b .* # [0-9a-f]+ <fn2@plt>
+ +[0-9a-f]+: 4c000001 jirl \$ra, \$zero, 0
+ +[0-9a-f]+: ........ bl .* # [0-9a-f]+ <fn2@plt>
-0+120000678 <medium_call_nop>:
- 120000678: 1e000001 pcaddu18i \$ra, 0
- 12000067c: 4c000001 jirl \$ra, \$zero, 0
- 120000680: 1e000001 pcaddu18i \$ra, 0
- 120000684: 4ffe5021 jirl \$ra, \$ra, -432
- 120000688: 1e00000c pcaddu18i \$t0, 0
- 12000068c: 4c000000 jr \$zero
- 120000690: 1e00000c pcaddu18i \$t0, 0
- 120000694: 4ffe4180 jirl \$zero, \$t0, -448
+[0-9a-f]+ <medium_call_nop>:
+ +[0-9a-f]+: 1e000001 pcaddu18i \$ra, 0
+ +[0-9a-f]+: 4c000001 jirl \$ra, \$zero, 0
+ +[0-9a-f]+: 1e000001 pcaddu18i \$ra, 0
+ +[0-9a-f]+: ........ jirl \$ra, \$ra, .*
+ +[0-9a-f]+: 1e00000c pcaddu18i \$t0, 0
+ +[0-9a-f]+: 4c000000 jr \$zero
+ +[0-9a-f]+: 1e00000c pcaddu18i \$t0, 0
+ +[0-9a-f]+: ........ jirl \$zero, \$t0, .*
diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
index d7c2b31..004c199 100644
--- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
+++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
@@ -147,7 +147,7 @@ if [istarget "loongarch64-*-*"] {
run_cc_link_tests [list \
[list \
"call undefweak symbol" \
- "" "" \
+ "-no-pie" "" \
{call_undefweak.s} \
{{objdump {-d} call_undefweak.d}} \
"call_undefweak" \