aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authormengqinggang <mengqinggang@loongson.cn>2022-08-30 16:27:55 +0800
committerliuzhensong <liuzhensong@loongson.cn>2022-09-07 11:19:38 +0800
commitf555b327d41ed72ffae28caae550f5f86312db43 (patch)
treeeb34aaef33ae8d448e5e3a59fb4642814752f15c /gas/testsuite
parent3c4e2282566d54b974f6929ee5c1270fb3cea4e5 (diff)
downloadgdb-f555b327d41ed72ffae28caae550f5f86312db43.zip
gdb-f555b327d41ed72ffae28caae550f5f86312db43.tar.gz
gdb-f555b327d41ed72ffae28caae550f5f86312db43.tar.bz2
LoongArch: fix gas BFD_RELOC_8/16/24 bug
If fixP->fx_subsy is NULL, BFD_RELOC_8/16/24 can't convert to BFD_RELOC_LARCH_xxx. gas/config/tc-loongarch.c
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/loongarch/bfd_reloc_8.s16
-rw-r--r--gas/testsuite/gas/loongarch/loongarch.exp1
2 files changed, 17 insertions, 0 deletions
diff --git a/gas/testsuite/gas/loongarch/bfd_reloc_8.s b/gas/testsuite/gas/loongarch/bfd_reloc_8.s
new file mode 100644
index 0000000..27388a5
--- /dev/null
+++ b/gas/testsuite/gas/loongarch/bfd_reloc_8.s
@@ -0,0 +1,16 @@
+# from linux kernel entry.s
+# test line 10 ".byte \type", BFD_RELOC_8 -> BFD_RELOC_RLARCH_ADD8 -> R_LARCH_ADD8
+
+.macro UNWIND_HINT type:req sp_reg=0 sp_offset=0 end=0
+.Lunwind_hint_ip_\@:
+ .pushsection .discard.unwind_hints
+ .long .Lunwind_hint_ip_\@ - .
+ .short \sp_offset
+ .byte \sp_reg
+ .byte \type
+ .byte \end
+ .balign 4
+ .popsection
+.endm
+
+UNWIND_HINT type=ORC_TYPE_CALL sp_reg=2
diff --git a/gas/testsuite/gas/loongarch/loongarch.exp b/gas/testsuite/gas/loongarch/loongarch.exp
index 34a2f78..b8ee4b2 100644
--- a/gas/testsuite/gas/loongarch/loongarch.exp
+++ b/gas/testsuite/gas/loongarch/loongarch.exp
@@ -20,4 +20,5 @@
if [istarget loongarch*-*-*] {
run_dump_tests [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+ gas_test_old bfd_reloc_8.s "" "bfd_reloc_8"
}