summaryrefslogtreecommitdiff
path: root/patches/binutils/2.24
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2016-02-05 21:09:51 (GMT)
committerMax Filippov <jcmvbkbc@gmail.com>2016-02-05 22:19:45 (GMT)
commitb1459d123f51063b61a8039126c064ffa8e620ae (patch)
treef80de2ab7d1e7ae6d656749c550fc5372190c1d7 /patches/binutils/2.24
parentce83329f4da559ebaf0210ec821da541cb62bc49 (diff)
binutils: fix .loc handling in xtensa gas
Binutils 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. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'patches/binutils/2.24')
-rw-r--r--patches/binutils/2.24/914-xtensa-fix-signedness-of-gas-relocations.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/patches/binutils/2.24/914-xtensa-fix-signedness-of-gas-relocations.patch b/patches/binutils/2.24/914-xtensa-fix-signedness-of-gas-relocations.patch
new file mode 100644
index 0000000..2955e11
--- /dev/null
+++ b/patches/binutils/2.24/914-xtensa-fix-signedness-of-gas-relocations.patch
@@ -0,0 +1,47 @@
+From 6c7c5c477ef9ccf2d2548cf2ac3cec9bd3c9c5b6 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Tue, 2 Feb 2016 17:11:38 +0300
+Subject: [PATCH] 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.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gas/config/tc-xtensa.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
+index a119871..36a06cc 100644
+--- a/gas/config/tc-xtensa.c
++++ b/gas/config/tc-xtensa.c
+@@ -5961,15 +5961,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
+ {
+ case BFD_RELOC_8:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF8;
+- fixP->fx_signed = 1;
++ fixP->fx_signed = 0;
+ break;
+ case BFD_RELOC_16:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF16;
+- fixP->fx_signed = 1;
++ fixP->fx_signed = 0;
+ break;
+ case BFD_RELOC_32:
+ fixP->fx_r_type = BFD_RELOC_XTENSA_DIFF32;
+- fixP->fx_signed = 1;
++ fixP->fx_signed = 0;
+ break;
+ default:
+ break;
+--
+2.1.4
+