public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RFA: A small mips gas patch
@ 2003-05-04 23:36 H. J. Lu
  2003-05-05  5:53 ` Eric Christopher
  2003-05-05 22:16 ` Eric Christopher
  0 siblings, 2 replies; 7+ messages in thread
From: H. J. Lu @ 2003-05-04 23:36 UTC (permalink / raw)
  To: binutils

I am trying to push out all my local changes. One of them is

http://sources.redhat.com/ml/binutils/2003-03/msg00177.html

Could someone please approve or disapprove it?

Thanks.


H.J.

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

* Re: RFA: A small mips gas patch
  2003-05-04 23:36 RFA: A small mips gas patch H. J. Lu
@ 2003-05-05  5:53 ` Eric Christopher
  2003-05-05  5:56   ` H. J. Lu
  2003-05-05 22:16 ` Eric Christopher
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Christopher @ 2003-05-05  5:53 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Sun, 2003-05-04 at 16:36, H. J. Lu wrote:
> I am trying to push out all my local changes. One of them is
> 
> http://sources.redhat.com/ml/binutils/2003-03/msg00177.html

Do you have a testcase for what you are trying to fix with it?

-eric

-- 
Eric Christopher <echristo@redhat.com>

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

* Re: RFA: A small mips gas patch
  2003-05-05  5:53 ` Eric Christopher
@ 2003-05-05  5:56   ` H. J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H. J. Lu @ 2003-05-05  5:56 UTC (permalink / raw)
  To: Eric Christopher; +Cc: binutils

On Sun, May 04, 2003 at 10:53:12PM -0700, Eric Christopher wrote:
> On Sun, 2003-05-04 at 16:36, H. J. Lu wrote:
> > I am trying to push out all my local changes. One of them is
> > 
> > http://sources.redhat.com/ml/binutils/2003-03/msg00177.html
> 
> Do you have a testcase for what you are trying to fix with it?
> 

I don't.


H.J.

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

* Re: RFA: A small mips gas patch
  2003-05-04 23:36 RFA: A small mips gas patch H. J. Lu
  2003-05-05  5:53 ` Eric Christopher
@ 2003-05-05 22:16 ` Eric Christopher
  2003-05-05 23:03   ` H. J. Lu
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Christopher @ 2003-05-05 22:16 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Sun, 2003-05-04 at 16:36, H. J. Lu wrote:
> I am trying to push out all my local changes. One of them is
> 
> http://sources.redhat.com/ml/binutils/2003-03/msg00177.html
> 
> Could someone please approve or disapprove it?

I don't think it really makes sense - at least not without seeing what
it's fixing. We're adding that back in there since we subtracted it
twice in md_apply_fix3...

-eric

-- 
Eric Christopher <echristo@redhat.com>

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

* Re: RFA: A small mips gas patch
  2003-05-05 22:16 ` Eric Christopher
@ 2003-05-05 23:03   ` H. J. Lu
  2003-05-06  0:10     ` Eric Christopher
  0 siblings, 1 reply; 7+ messages in thread
From: H. J. Lu @ 2003-05-05 23:03 UTC (permalink / raw)
  To: Eric Christopher; +Cc: binutils

On Mon, May 05, 2003 at 03:16:13PM -0700, Eric Christopher wrote:
> On Sun, 2003-05-04 at 16:36, H. J. Lu wrote:
> > I am trying to push out all my local changes. One of them is
> > 
> > http://sources.redhat.com/ml/binutils/2003-03/msg00177.html
> > 
> > Could someone please approve or disapprove it?
> 
> I don't think it really makes sense - at least not without seeing what
> it's fixing. We're adding that back in there since we subtracted it
> twice in md_apply_fix3...
> 

It will be subtracted twice only if howto->partial_inplace is true. In
md_apply_fix3, there are

	value -= symval;
	howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
	if (value != 0 && howto && howto->partial_inplace
				   ^^^^^^^^^^^^^^^^^^^^^
	    && (! fixP->fx_pcrel || howto->pcrel_offset))
	  {
	    ...
	    value -= symval;
	    ...
	  }

If howto->partial_inplace is false, it will be only subtracted once.
Did I miss something here?


H.J.

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

* Re: RFA: A small mips gas patch
  2003-05-05 23:03   ` H. J. Lu
@ 2003-05-06  0:10     ` Eric Christopher
  2003-05-06  0:29       ` H. J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Christopher @ 2003-05-06  0:10 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils


> 
> It will be subtracted twice only if howto->partial_inplace is true. In
> md_apply_fix3, there are
> 
> 	value -= symval;
> 	howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
> 	if (value != 0 && howto && howto->partial_inplace
> 				   ^^^^^^^^^^^^^^^^^^^^^
> 	    && (! fixP->fx_pcrel || howto->pcrel_offset))
> 	  {
> 	    ...
> 	    value -= symval;
> 	    ...
> 	  }
> 
> If howto->partial_inplace is false, it will be only subtracted once.
> Did I miss something here?

Nope. I did.

Go ahead.

Thanks.

-eric

-- 
Eric Christopher <echristo@redhat.com>

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

* Re: RFA: A small mips gas patch
  2003-05-06  0:10     ` Eric Christopher
@ 2003-05-06  0:29       ` H. J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H. J. Lu @ 2003-05-06  0:29 UTC (permalink / raw)
  To: Eric Christopher; +Cc: binutils

On Mon, May 05, 2003 at 05:10:28PM -0700, Eric Christopher wrote:
> 
> > 
> > It will be subtracted twice only if howto->partial_inplace is true. In
> > md_apply_fix3, there are
> > 
> > 	value -= symval;
> > 	howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
> > 	if (value != 0 && howto && howto->partial_inplace
> > 				   ^^^^^^^^^^^^^^^^^^^^^
> > 	    && (! fixP->fx_pcrel || howto->pcrel_offset))
> > 	  {
> > 	    ...
> > 	    value -= symval;
> > 	    ...
> > 	  }
> > 
> > If howto->partial_inplace is false, it will be only subtracted once.
> > Did I miss something here?
> 
> Nope. I did.
> 

This is what I checked in.

Thanks.

2003-05-05  H.J. Lu <hjl@gnu.org>

	* config/tc-mips.c (tc_gen_reloc): Add addend just once if
	howto->partial_inplace is false.

--- config/tc-mips.c.orig	Mon Apr 28 09:49:27 2003
+++ config/tc-mips.c	Mon May  5 17:18:17 2003
@@ -13931,7 +13931,15 @@ tc_gen_reloc (section, fixp)
       && (code == BFD_RELOC_GPREL16 || code == BFD_RELOC_MIPS16_GPREL)
       && reloc->addend != 0
       && mips_need_elf_addend_fixup (fixp))
-    reloc->addend += S_GET_VALUE (fixp->fx_addsy);
+    {
+      /* If howto->partial_inplace is false, md_apply_fix3 will only
+	 subtract it once.  */
+      reloc_howto_type *howto;
+
+      howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
+      if (howto->partial_inplace)
+	reloc->addend += S_GET_VALUE (fixp->fx_addsy);
+    }
 #endif
 
   /* To support a PC relative reloc when generating embedded PIC code

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

end of thread, other threads:[~2003-05-06  0:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-04 23:36 RFA: A small mips gas patch H. J. Lu
2003-05-05  5:53 ` Eric Christopher
2003-05-05  5:56   ` H. J. Lu
2003-05-05 22:16 ` Eric Christopher
2003-05-05 23:03   ` H. J. Lu
2003-05-06  0:10     ` Eric Christopher
2003-05-06  0:29       ` H. J. Lu

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