public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
To: binutils@sources.redhat.com
Subject: Re: [PATCH] Fix handling of R_MIPS_PC16 relocations
Date: Wed, 12 Sep 2001 11:31:00 -0000	[thread overview]
Message-ID: <20010912203121.A6668@rembrandt.csv.ica.uni-stuttgart.de> (raw)
In-Reply-To: <Pine.GSO.3.96.1010912171746.3453A-100000@delta.ds2.pg.gda.pl>

Maciej W. Rozycki wrote:
[snip]
>  I don't think the following bit is OK -- you've just defined
> BFD_RELOC_16_PCREL to behave just like BFD_RELOC_16_PCREL_S2 would: 
> 
> diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/config/tc-mips.c src/gas/config/tc-mips.c
> --- src-orig/gas/config/tc-mips.c	Fri Aug 31 22:00:08 2001
> +++ src/gas/config/tc-mips.c	Thu Sep  6 21:58:05 2001
> @@ -1898,6 +1978,10 @@ append_insn (place, ip, address_expr, re
>  		 | ((address_expr->X_add_number & 0x3fffc) >> 2));
>  	      break;
>  
> +	    case BFD_RELOC_16_PCREL:
> +	      ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0xffff;
> +	      break;
> +
>  	    case BFD_RELOC_16_PCREL_S2:
>  	      goto need_reloc;
>  
> 
>  You'd do something like "ip->insn_opcode |= address_expr->X_add_number &
> 0xffff" for a BFD_RELOC_16_PCREL reloc. 

I've overlooked this reminiscent from my earlier patch, thanks
for reviewing. I'll check in the following patch under the obvious
rule.


Thiemo


2001-09-12  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>

	/gas/ChangeLog
	* config/tc-mips.c (append_insn): Don't rightshift BFD_RELOC_16_PCREL.


diff -BurpNX /bigdisk/src/binutils-exclude src-orig/gas/config/tc-mips.c src/gas/config/tc-mips.c
--- src-orig/gas/config/tc-mips.c	Fri Sep  7 08:11:31 2001
+++ src/gas/config/tc-mips.c	Wed Sep 12 19:55:09 2001
@@ -1899,7 +1978,7 @@ append_insn (place, ip, address_expr, re
 	      break;
 
 	    case BFD_RELOC_16_PCREL:
-	      ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0xffff;
+	      ip->insn_opcode |= address_expr->X_add_number & 0xffff;
 	      break;
 
 	    case BFD_RELOC_16_PCREL_S2:

      reply	other threads:[~2001-09-12 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-26 14:30 Thiemo Seufer
2001-09-06 16:00 ` Thiemo Seufer
2001-09-06 21:45   ` Eric Christopher
2001-09-12  8:40   ` Maciej W. Rozycki
2001-09-12 11:31     ` Thiemo Seufer [this message]

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=20010912203121.A6668@rembrandt.csv.ica.uni-stuttgart.de \
    --to=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=binutils@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).