public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: binutils@sourceware.org
Subject: [PATCH] MIPS gas: Simplify MIPS16 jump relocation handling
Date: Mon, 31 Jul 2006 17:26:00 -0000	[thread overview]
Message-ID: <20060731172544.GL15011@networkno.de> (raw)

Hello All,

I applied the appended patch, it simplifies handling of
BFD_RELOC_MIPS16_JMP relocations.

Thanks to Richard Sandiford for the suggestion.


Thiemo


2006-07-31  Thiemo Seufer  <ths@mips.com>

	* config/tc-mips.c (md_apply_fix, tc_gen_reloc): Remove special
	handling for BFD_RELOC_MIPS16_JMP.


Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.351
diff -u -p -r1.351 tc-mips.c
--- gas/config/tc-mips.c	20 Jul 2006 16:51:38 -0000	1.351
+++ gas/config/tc-mips.c	31 Jul 2006 14:10:49 -0000
@@ -11787,14 +11787,8 @@ md_apply_fix (fixS *fixP, valueT *valP, 
     case BFD_RELOC_MIPS16_GPREL:
     case BFD_RELOC_MIPS16_HI16:
     case BFD_RELOC_MIPS16_HI16_S:
-      /* Nothing needed to do. The value comes from the reloc entry */
-      break;
-
     case BFD_RELOC_MIPS16_JMP:
-      /* We currently always generate a reloc against a symbol, which
-         means that we don't want an addend even if the symbol is
-         defined.  */
-      *valP = 0;
+      /* Nothing needed to do. The value comes from the reloc entry */
       break;
 
     case BFD_RELOC_64:
@@ -13568,10 +13559,6 @@ tc_gen_reloc (asection *section ATTRIBUT
   else
     reloc->addend = fixp->fx_addnumber;
 
-  /* Handle relocs adjusted against a section symbol.  */
-  if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP)
-    reloc->addend += fixp->fx_offset;
-
   /* Since the old MIPS ELF ABI uses Rel instead of Rela, encode the vtable
      entry to be used in the relocation's section offset.  */
   if (! HAVE_NEWABI && fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)

             reply	other threads:[~2006-07-31 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 17:26 Thiemo Seufer [this message]
2006-07-31 17:43 ` Martin Michlmayr
2006-07-31 18:01   ` Eric Christopher
2006-08-01  5:50     ` Thiemo Seufer
2006-08-01 15:01 ` Richard Sandiford

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=20060731172544.GL15011@networkno.de \
    --to=ths@networkno.de \
    --cc=binutils@sourceware.org \
    /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).