public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@zembu.com>
To: mark@codesourcery.com
Cc: geoffk@ozemail.com.au, gavin@cygnus.com,
	binutils@sourceware.cygnus.com, brendan@cygnus.com
Subject: Re: Reloc changes to bfd/elf32-mips.c
Date: Tue, 28 Sep 1999 06:57:00 -0000	[thread overview]
Message-ID: <19990928135607.6136.qmail@daffy.airs.com> (raw)
In-Reply-To: <19990928005956V.mitchell@codesourcery.com>

   From: Mark Mitchell <mark@codesourcery.com>
   Date: Tue, 28 Sep 1999 00:59:56 -0700

     @@ -6628,26 +6629,11 @@ _bfd_mips_elf_relocate_section (output_b
		       l &= lo16_howto->src_mask;
		       l = mips_elf_sign_extend (l, 16);

     -		  /* Save the high-order bit for later.  When we
     -		     encounter the R_MIPS_LO16 relocation we will need
     -		     them again.  */
		       addend <<= 16;
     -		  last_hi16_addend = addend;
     -		  last_hi16_addend_valid_p = true;

		       /* Compute the combined addend.  */
		       addend += l;
		     }
     -	      else if (r_type == R_MIPS_LO16) 
     -		{
     -		  /* Used the saved HI16 addend.  */
     -		  if (!last_hi16_addend_valid_p)
     -		    {
     -		      bfd_set_error (bfd_error_bad_value);
     -		      return false;
     -		    }
     -		  addend |= last_hi16_addend;
     -		}
		   else if (r_type == R_MIPS16_GPREL)
		     {
		       /* The addend is scrambled in the object file.  See

   Why is all this code going away?  This looks like it will make
   R_MIPS_LO16 not work in .rel sections.  The addend for the LO16
   relocation is the combination of bits in the HI16 and LO16 relocs, I
   think.

When computing the addend for a LO16 relocation, you don't need any
information from the HI16 relocation.  That's just math: the HI16
relocation can only contribute to the upper 16 bits, which the LO16
relocation doesn't use.  (The reverse is not true, because the LO16
relocation bits can carry into the HI16 relocation bits).

I think Geoff is trying to restore an extension we used to have, which
is to permit a LO16 relocation without a HI16 relocation.

Ian

  reply	other threads:[~1999-09-28  6:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-27  4:30 Geoff Keating
1999-09-27 12:37 ` Mark Mitchell
1999-09-28  0:54 ` Mark Mitchell
1999-09-28  6:57   ` Ian Lance Taylor [this message]
1999-09-28 20:32   ` Geoff Keating
1999-09-28 20:57     ` Ian Lance Taylor
1999-09-28 21:52       ` Geoff Keating
1999-09-28 22:03         ` Ian Lance Taylor
1999-10-06 19:21           ` Geoff Keating
1999-10-06 19:35             ` Ian Lance Taylor
1999-10-06 20:39               ` Geoff Keating
1999-10-06 20:53                 ` Ian Lance Taylor
1999-10-07  4:47                   ` Geoff Keating
1999-10-07  7:28                     ` Ian Lance Taylor
1999-10-07  9:17                     ` Mark Mitchell
1999-09-28 22:16     ` Mark Mitchell
1999-09-29  8:25       ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
1999-09-27  4:24 Geoff Keating
1999-09-27 18:25 ` Ian Lance Taylor

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=19990928135607.6136.qmail@daffy.airs.com \
    --to=ian@zembu.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=brendan@cygnus.com \
    --cc=gavin@cygnus.com \
    --cc=geoffk@ozemail.com.au \
    --cc=mark@codesourcery.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).