[RFA cgen&gas] add TLS support for FR-V FDPIC

Alexandre Oliva aoliva@redhat.com
Tue Jan 25 10:02:00 GMT 2005


This patch adds TLS support to the FR-V target, within the FDPIC ABI.
Because the TLS ABI extension requires annotations such as #tlsmoff(0)
to actually generate a relocation for *ABS*+0, I had to tweak cgen asm
parsing machinery to enable a fix-up to be generated for expressions
that could be handled as a simple numerical value, upon request.  As
it turned out, this enabled a number of other relocations that used to
be simply discarded to be generated properly as well (for some
definition of properly, given that say #gotoff(0) doesn't make a lot
of sense).

The portion of the patch that implements this change in cgen and gas,
that I request permission to install, is below.  ChangeLog entries are
part of the bigger attached patch, and not duplicated in the inline
text.  The rest, posted for reference, affects only the FRV port of
binutils, of which I'm a maintainer, so don't bother to review it
unless you feel like it.  That said, comments are welcome, especially
suggestions on how to better handle the apparent ambiguity between
*ABS* and *UND* sections I've run into.

Since there are lots of testcases, I had to compress the entire patch,
otherwise it would exceed 300KiB.

Ok to install the inline bits below?

Index: include/opcode/cgen.h
===================================================================
RCS file: /cvs/uberbaum/include/opcode/cgen.h,v
retrieving revision 1.19
diff -u -p -r1.19 cgen.h
--- include/opcode/cgen.h 8 Aug 2003 21:21:24 -0000 1.19
+++ include/opcode/cgen.h 25 Jan 2005 09:38:11 -0000
@@ -369,7 +369,8 @@ enum cgen_parse_operand_type
 {
   CGEN_PARSE_OPERAND_INIT,
   CGEN_PARSE_OPERAND_INTEGER,
-  CGEN_PARSE_OPERAND_ADDRESS
+  CGEN_PARSE_OPERAND_ADDRESS,
+  CGEN_PARSE_OPERAND_SYMBOLIC
 };
 
 /* Values for indicating what was parsed.  */
Index: gas/cgen.c
===================================================================
RCS file: /cvs/uberbaum/gas/cgen.c,v
retrieving revision 1.24
diff -u -p -r1.24 cgen.c
--- gas/cgen.c 25 Jun 2004 16:11:09 -0000 1.24
+++ gas/cgen.c 25 Jan 2005 09:38:40 -0000
@@ -372,6 +372,8 @@ gas_cgen_parse_operand (cd, want, strP, 
       *resultP = CGEN_PARSE_OPERAND_RESULT_ERROR;
       break;
     case O_constant:
+      if (want == CGEN_PARSE_OPERAND_SYMBOLIC)
+	goto de_fault;
       *valueP = exp.X_add_number;
       *resultP = CGEN_PARSE_OPERAND_RESULT_NUMBER;
       break;
@@ -379,6 +381,7 @@ gas_cgen_parse_operand (cd, want, strP, 
       *valueP = exp.X_add_number;
       *resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER;
       break;
+    de_fault:
     default:
       queue_fixup (opindex, opinfo, &exp);
       *valueP = 0;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: frv-tls-binutils.patch.bz2
Type: application/x-bzip2
Size: 39271 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050125/d853d53c/attachment.bz2>
-------------- next part --------------

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Binutils mailing list