aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2016-02-02 17:11:38 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2016-02-03 20:44:57 +0300
commitea173078d2c0c1af13a8b315ca187ffa4d00cd66 (patch)
tree2dff54ce68447dd4d78c34d6f85bc38861770df7 /gas/testsuite
parent0cb4071ef9e10f703220f5e731141bf438aca16e (diff)
downloadgdb-ea173078d2c0c1af13a8b315ca187ffa4d00cd66.zip
gdb-ea173078d2c0c1af13a8b315ca187ffa4d00cd66.tar.gz
gdb-ea173078d2c0c1af13a8b315ca187ffa4d00cd66.tar.bz2
xtensa: fix signedness of gas relocations
Change 1058c7532d0b "Use signed data type for R_XTENSA_DIFF* relocation offsets." changed signedness of BFD_RELOC_XTENSA_DIFF* relocations substituted for BFD_RELOC_*. This made it impossible to encode arbitrary 8-, 16- and 32-bit values, which broke e.g. debug info encoding by .loc directive. Revert this part and add test. gas/ 2016-02-03 Max Filippov <jcmvbkbc@gmail.com> * config/tc-xtensa.c (md_apply_fix): Mark BFD_RELOC_XTENSA_DIFF* substitutions for BFD_RELOC_* as unsigned. * gas/testsuite/gas/xtensa/all.exp: Add loc to list of xtensa tests. * gas/testsuite/gas/xtensa/loc.d: New file: loc test result patterns. * gas/testsuite/gas/xtensa/loc.s: New file: loc test.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/xtensa/all.exp1
-rw-r--r--gas/testsuite/gas/xtensa/loc.d10
-rw-r--r--gas/testsuite/gas/xtensa/loc.s7
3 files changed, 18 insertions, 0 deletions
diff --git a/gas/testsuite/gas/xtensa/all.exp b/gas/testsuite/gas/xtensa/all.exp
index 31b725b..7ff7bd7 100644
--- a/gas/testsuite/gas/xtensa/all.exp
+++ b/gas/testsuite/gas/xtensa/all.exp
@@ -101,6 +101,7 @@ if [istarget xtensa*-*-*] then {
run_dump_test "trampoline"
run_dump_test "first_frag_align"
run_dump_test "auto-litpools"
+ run_dump_test "loc"
}
if [info exists errorInfo] then {
diff --git a/gas/testsuite/gas/xtensa/loc.d b/gas/testsuite/gas/xtensa/loc.d
new file mode 100644
index 0000000..71983cc
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/loc.d
@@ -0,0 +1,10 @@
+#as:
+#objdump: -r
+#name: .loc directive relocs
+
+.*: +file format .*xtensa.*
+
+RELOCATION RECORDS FOR \[\.debug_line\]:
+#...
+.*R_XTENSA_DIFF16.*\.text\+0x00009c42
+#...
diff --git a/gas/testsuite/gas/xtensa/loc.s b/gas/testsuite/gas/xtensa/loc.s
new file mode 100644
index 0000000..029e14e
--- /dev/null
+++ b/gas/testsuite/gas/xtensa/loc.s
@@ -0,0 +1,7 @@
+ .text
+ .file 1 "loc.s"
+ .loc 1 3
+ nop
+ .space 40000
+ .loc 1 5
+ nop