This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/binutils-2_32-branch] xtensa: gas: don't keep relocations for constants


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0b404f6e52938b3ca2139658a6ae6755277c9258

commit 0b404f6e52938b3ca2139658a6ae6755277c9258
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Fri Jan 25 18:52:32 2019 -0800

    xtensa: gas: don't keep relocations for constants
    
    xtensa gas chokes on 8/16 bit data entries representing constant symbols
    because it leaves BFD_RELOC_8/BFD_RELOC_16 fixups for which xtensa BFD
    cannot emit relocations. Resolve fixups for constant symbols in
    md_apply_fix.
    
    gas/
    2019-01-29  Max Filippov  <jcmvbkbc@gmail.com>
    
    	* config/tc-xtensa.c (md_apply_fix): Mark fixups for constant
    	symbols as done in md_apply_fix.
    	* testsuite/gas/all/forward.d: Don't XFAIL for xtensa.

Diff:
---
 gas/ChangeLog                   | 6 ++++++
 gas/config/tc-xtensa.c          | 6 ++++++
 gas/testsuite/gas/all/forward.d | 2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1bf6616..58cc787 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-29  Max Filippov  <jcmvbkbc@gmail.com>
+
+	* config/tc-xtensa.c (md_apply_fix): Mark fixups for constant
+	symbols as done in md_apply_fix.
+	* testsuite/gas/all/forward.d: Don't XFAIL for xtensa.
+
 2019-01-28  Alan Modra  <amodra@gmail.com>
 
 	* configure.ac (ac_checking): Set from bfd/development.sh
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 23bb2d2..3bdbbc9 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -6019,6 +6019,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
 	  val = *valP;
 	  fixP->fx_done = 1;
 	}
+      else if (S_GET_SEGMENT (fixP->fx_addsy) == absolute_section)
+	{
+	  val = S_GET_VALUE (fixP->fx_addsy) + fixP->fx_offset;
+	  *valP = val;
+	  fixP->fx_done = 1;
+	}
       /* fall through */
 
     case BFD_RELOC_XTENSA_PLT:
diff --git a/gas/testsuite/gas/all/forward.d b/gas/testsuite/gas/all/forward.d
index 9750133..5a7f370 100644
--- a/gas/testsuite/gas/all/forward.d
+++ b/gas/testsuite/gas/all/forward.d
@@ -1,7 +1,7 @@
 #objdump: -s -j .data
 #name: forward references
 # Some targets don't manage to resolve BFD_RELOC_8 for constants.
-#xfail: *c30-*-* *c4x-*-* d10v-*-* d30v-*-* pdp11-*-* xtensa*-*-*
+#xfail: *c30-*-* *c4x-*-* d10v-*-* d30v-*-* pdp11-*-*
 
 .*: .*


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]