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] TLS: DTPOFF can accept offsets, stored into addendum. Remove the need of base


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

commit 05bbf0164a4b3a78ee6d2d575a10800fdf1af5b0
Author: Claudiu Zissulescu <claziss@synopsys.com>
Date:   Thu Jun 30 15:11:57 2016 +0200

    TLS: DTPOFF can accept offsets, stored into addendum. Remove the need of base
    
    gas/ChangeLog:
    
    2016-07-05  Claudiu Zissulescu  <claziss@synopsys.com>
    
      * config/tc-arc.c (arc_reloc_op_tag): Allow complex ops for dtpoff.
      (tc_gen_reloc): Remove passing DTPOFF base info into reloc addendum as it is
      no longer needed.
    
    Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>

Diff:
---
 gas/ChangeLog       |  6 ++++++
 gas/config/tc-arc.c | 25 ++-----------------------
 2 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index d4f2e9b..da04199 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2016-07-11  Claudiu Zissulescu  <claziss@synopsys.com>
+
+	* config/tc-arc.c (arc_reloc_op_tag): Allow complex ops for dtpoff.
+	(tc_gen_reloc): Remove passing DTPOFF base info into reloc addendum
+	as it is no longer needed.
+
 2016-07-04  Jan Beulich  <jbeulich@suse.com>
 
 	* config/tc-i386.c (check_qword_reg): Correct register kind
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 2046604..70886dd 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -502,7 +502,7 @@ static const struct arc_reloc_op_tag
   DEF (tpoff9,  BFD_RELOC_ARC_TLS_LE_S9,	0),
   DEF (tpoff,   BFD_RELOC_ARC_TLS_LE_32,	1),
   DEF (dtpoff9, BFD_RELOC_ARC_TLS_DTPOFF_S9,	0),
-  DEF (dtpoff,  BFD_RELOC_ARC_TLS_DTPOFF,	0),
+  DEF (dtpoff,  BFD_RELOC_ARC_TLS_DTPOFF,	1),
 };
 
 static const int arc_num_reloc_op
@@ -3130,28 +3130,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
 
   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
 
-  if (code == BFD_RELOC_ARC_TLS_DTPOFF
-      || code ==  BFD_RELOC_ARC_TLS_DTPOFF_S9)
-    {
-      asymbol *sym
-	= fixP->fx_subsy ? symbol_get_bfdsym (fixP->fx_subsy) : NULL;
-      /* We just want to store a 24 bit index, but we have to wait
-	 till after write_contents has been called via
-	 bfd_map_over_sections before we can get the index from
-	 _bfd_elf_symbol_from_bfd_symbol.  Thus, the write_relocs
-	 function is elf32-arc.c has to pick up the slack.
-	 Unfortunately, this leads to problems with hosts that have
-	 pointers wider than long (bfd_vma).  There would be various
-	 ways to handle this, all error-prone :-(  */
-      reloc->addend = (bfd_vma) sym;
-      if ((asymbol *) reloc->addend != sym)
-	{
-	  as_bad ("Can't store pointer\n");
-	  return NULL;
-	}
-    }
-  else
-    reloc->addend = fixP->fx_offset;
+  reloc->addend = fixP->fx_offset;
 
   return reloc;
 }


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