public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* [RFA cgen&gas] add TLS support for FR-V FDPIC
@ 2005-01-25 10:02 Alexandre Oliva
  2005-01-25 21:37 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Oliva @ 2005-01-25 10:02 UTC (permalink / raw)
  To: binutils, cgen; +Cc: aldyh

[-- Attachment #1: Type: text/plain, Size: 2625 bytes --]

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;


[-- Attachment #2: frv-tls-binutils.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 39271 bytes --]

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
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}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA cgen&gas] add TLS support for FR-V FDPIC
  2005-01-25 10:02 [RFA cgen&gas] add TLS support for FR-V FDPIC Alexandre Oliva
@ 2005-01-25 21:37 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2005-01-25 21:37 UTC (permalink / raw)
  To: binutils; +Cc: cgen, aldyh

On Jan 25, 2005, Alexandre Oliva <aoliva@redhat.com> wrote:

> 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.

> Ok to install the inline bits below?

Frank Ch. Eigler approved the cgen changes in private, so I checked the
whole thing in.

-- 
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}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-25 21:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-25 10:02 [RFA cgen&gas] add TLS support for FR-V FDPIC Alexandre Oliva
2005-01-25 21:37 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).