From ea173078d2c0c1af13a8b315ca187ffa4d00cd66 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Tue, 2 Feb 2016 17:11:38 +0300 Subject: 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 * 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. --- gas/config/tc-xtensa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gas/config') 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; -- cgit v1.1