From: Lulu Cai Date: Tue, 10 Dec 2024 11:42:14 +0000 (+0800) Subject: LoongArch: Fix bfd ld failed test case X-Git-Tag: gdb-16-branchpoint~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c82e1ee93d57a2013c5acf94558c382e3e2e5c3;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/ld/testsuite/ld-loongarch-elf/call_undefweak.d b/ld/testsuite/ld-loongarch-elf/call_undefweak.d index 4761651817c..6eedfed3046 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 : - 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
: - 120000668: 4c000000 jr \$zero - 12000066c: 53fe67ff b -412 # 1200004d0 - 120000670: 4c000001 jirl \$ra, \$zero, 0 - 120000674: 57fe5fff bl -420 # 1200004d0 +[0-9a-f]+
: + +[0-9a-f]+: 4c000000 jr \$zero + +[0-9a-f]+: ........ b .* # [0-9a-f]+ + +[0-9a-f]+: 4c000001 jirl \$ra, \$zero, 0 + +[0-9a-f]+: ........ bl .* # [0-9a-f]+ -0+120000678 : - 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]+ : + +[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 d7c2b311f2f..004c1994673 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" \