public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: binutils@sources.redhat.com, cgen@sources.redhat.com
Cc: aldyh@redhat.com
Subject: [RFA cgen&gas] add TLS support for FR-V FDPIC
Date: Tue, 25 Jan 2005 10:02:00 -0000	[thread overview]
Message-ID: <or7jm1x1vy.fsf@livre.redhat.lsd.ic.unicamp.br> (raw)

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

             reply	other threads:[~2005-01-25 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25 10:02 Alexandre Oliva [this message]
2005-01-25 21:37 ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=or7jm1x1vy.fsf@livre.redhat.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=cgen@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).