]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LoongArch: Fix gas and ld test cases
authorLulu Cai <cailulu@loongson.cn>
Thu, 7 Mar 2024 03:09:14 +0000 (11:09 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Tue, 12 Mar 2024 09:37:12 +0000 (17:37 +0800)
* After adding the old LE relax, all old LE relocations will have
  an R_LARCH_RELAX relocation. Fix the gas test case failure caused
  by the implementation of the old LE relax.

* loongarch64-elf does not support pie and -z norelro options,
  removed in test files.

gas/testsuite/gas/loongarch/relocs_32.d
gas/testsuite/gas/loongarch/relocs_64.d
ld/testsuite/ld-loongarch-elf/desc-le-norelax.d
ld/testsuite/ld-loongarch-elf/desc-le-relax.d
ld/testsuite/ld-loongarch-elf/ie-le-norelax.d
ld/testsuite/ld-loongarch-elf/ie-le-relax.d
ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
ld/testsuite/ld-loongarch-elf/macro_op_32.d

index 3e1bb62e2632dca0ff85144dbeebb2e5594d1111..96ef2800a5132a14e238af9029ad23b745827bda 100644 (file)
@@ -30,8 +30,10 @@ Disassembly of section .text:
                        24: R_LARCH_GOT_LO12    .L1
   28:  14000004        lu12i.w         \$a0, 0
                        28: R_LARCH_TLS_LE_HI20 TLSL1
+                       28: R_LARCH_RELAX       \*ABS\*
   2c:  03800085        ori             \$a1, \$a0, 0x0
                        2c: R_LARCH_TLS_LE_LO12 TLSL1
+                       2c: R_LARCH_RELAX       \*ABS\*
   30:  1a000004        pcalau12i       \$a0, 0
                        30: R_LARCH_TLS_IE_PC_HI20      TLSL1
   34:  02c00005        li.d            \$a1, 0
index 631137eb174f31542f5a59701169d3fc6f6e9cd8..35dde02f7fc569aceb64e2aac950051aa360d4ce 100644 (file)
@@ -48,12 +48,16 @@ Disassembly of section .text:
                        48: R_LARCH_GOT64_HI12  .L1
   4c:  14000004        lu12i.w         \$a0, 0
                        4c: R_LARCH_TLS_LE_HI20 TLSL1
+                       4c: R_LARCH_RELAX       \*ABS\*
   50:  03800085        ori             \$a1, \$a0, 0x0
                        50: R_LARCH_TLS_LE_LO12 TLSL1
+                       50: R_LARCH_RELAX       \*ABS\*
   54:  16000004        lu32i.d         \$a0, 0
                        54: R_LARCH_TLS_LE64_LO20       TLSL1
+                       54: R_LARCH_RELAX       \*ABS\*
   58:  03000085        lu52i.d         \$a1, \$a0, 0
                        58: R_LARCH_TLS_LE64_HI12       TLSL1
+                       58: R_LARCH_RELAX       \*ABS\*
   5c:  1a000004        pcalau12i       \$a0, 0
                        5c: R_LARCH_TLS_IE_PC_HI20      TLSL1
   60:  02c00005        li.d            \$a1, 0
index 5a53245ad7fca325ec568ae12d3e97e405115a4d..43749f1b8192b48d57637c93097a219e1d7e16cb 100644 (file)
@@ -1,5 +1,5 @@
 #as:
-#ld: -z norelro -e0 --no-relax
+#ld: -e0 --no-relax
 #objdump: -dr
 #skip: loongarch32-*-*
 
index 03b5535edf87a6edb613c514c6c4fb078f22d45f..71a540fda30958527763f953bd79d09ae55db743 100644 (file)
@@ -1,5 +1,5 @@
 #as:
-#ld: -z norelro -e0
+#ld: -e0
 #objdump: -dr -M no-aliases
 #skip: loongarch32-*-*
 
index 81d78ca32455a87c31f830188d2620ca0cff64ed..0221b495d68700479ad34b07933a7950de5bfde7 100644 (file)
@@ -1,5 +1,5 @@
 #as:
-#ld: -z norelro -e0 --no-relax
+#ld: -e0 --no-relax
 #objdump: -dr
 #skip: loongarch32-*-*
 
index 03b5535edf87a6edb613c514c6c4fb078f22d45f..71a540fda30958527763f953bd79d09ae55db743 100644 (file)
@@ -1,5 +1,5 @@
 #as:
-#ld: -z norelro -e0
+#ld: -e0
 #objdump: -dr -M no-aliases
 #skip: loongarch32-*-*
 
index 161cc1a4d104cf432b695c516f467025fef8338a..507b244869cd9918e0db3573b7f4ee870fb35994 100644 (file)
@@ -133,6 +133,10 @@ if [istarget "loongarch64-*-*"] {
     run_dump_test "desc-relax"
   }
 
+  if [check_pie_support] {
+    run_dump_test "pie_discard"
+  }
+
   run_dump_test "max_imm_b16"
   run_dump_test "max_imm_b21"
   run_dump_test "max_imm_b26"
@@ -145,7 +149,6 @@ if [istarget "loongarch64-*-*"] {
   run_dump_test "underflow_b21"
   run_dump_test "underflow_b26"
   run_dump_test "underflow_pcrel20"
-  run_dump_test "pie_discard"
   run_dump_test "desc-le-norelax"
   run_dump_test "desc-le-relax"
   run_dump_test "ie-le-norelax"
index a7349aa8dc0b684e45ce7c0ae2447b6bb42efda3..8fd69922c1406cfa24f89b4770b337caf903568b 100644 (file)
@@ -49,12 +49,16 @@ Disassembly of section .text:
                        3c: R_LARCH_RELAX       \*ABS\*
   40:  14000004        lu12i.w         \$a0, 0
                        40: R_LARCH_TLS_LE_HI20 TLS1
+                       40: R_LARCH_RELAX       \*ABS\*
   44:  03800084        ori             \$a0, \$a0, 0x0
                        44: R_LARCH_TLS_LE_LO12 TLS1
+                       44: R_LARCH_RELAX       \*ABS\*
   48:  1a000004        pcalau12i       \$a0, 0
                        48: R_LARCH_TLS_IE_PC_HI20      TLS1
+                       48: R_LARCH_RELAX       \*ABS\*
   4c:  28800084        ld.w            \$a0, \$a0, 0
                        4c: R_LARCH_TLS_IE_PC_LO12      TLS1
+                       4c: R_LARCH_RELAX       \*ABS\*
   50:  1a000004        pcalau12i       \$a0, 0
                        50: R_LARCH_TLS_LD_PC_HI20      TLS1
                        50: R_LARCH_RELAX       \*ABS\*