]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LoongArch: Fix bfd ld failed test case
authorLulu Cai <cailulu@loongson.cn>
Tue, 10 Dec 2024 11:42:14 +0000 (19:42 +0800)
committercailulu <cailulu@loongson.cn>
Mon, 16 Dec 2024 07:45:45 +0000 (15:45 +0800)
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.

ld/testsuite/ld-loongarch-elf/call_undefweak.d
ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp

index 4761651817c6c5c905a2a992b0757d31657cb602..6eedfed30460929786eea8029eb63e2aacdc5d76 100644 (file)
@@ -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, .*
index d7c2b311f2ff938ae7a38d3bdf3efe0ec501c496..004c1994673893771b94bd855fa97ec1fdc3e850 100644 (file)
@@ -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" \