public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@zembu.com>
To: jj@sunsite.ms.mff.cuni.cz
Cc: binutils@sourceware.cygnus.com, davem@redhat.com
Subject: Re: [PATCH] Support for R_SPARC_OLO10 relocations
Date: Fri, 09 Jul 1999 09:52:00 -0000	[thread overview]
Message-ID: <19990709154144.7682.qmail@daffy.airs.com> (raw)
In-Reply-To: <19990709083424.B1736@mff.cuni.cz>

   Date: Fri, 9 Jul 1999 08:34:24 +0200
   From: Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>

   Yes, R_SPARC_OLO10 is part of the SYSV ABI sparc64 supplement.

OK.

   And it has a reason to have two addends: it is used for instructions which
   have signed 13bit field for the immediate, but the standard way of
   constructing addresses is sethi into some register, which sets upper 22 bits
   and then the second instruction fills in just 10 bits in the 13bit
   immediate. So, one usually does
	   sethi %hi(ab-24), %g1
	   ld [%g1 + %lo(ab-24)], %g2
   which means 3 bits in the second instruction's immediate are always 0.
   So the R_SPARC_OLO10 makes me use those 3 bits, so that the sethi can be
   shared among multiple instructions. The relocation is computed as
   (((SYMBOL + ADDEND) & 0x3ff) + SECONDARYADDEND) & 0x1fff. The secondary
   addend really does not behave like the normal addend in there, because bfd
   should not change it ever, no matter how is symbol moved.

My point was that the second addend could simply have been stored in
the object file itself.  The second addend can only be 13 bits, and
there are 13 bits available in the object file.  There was no need to
store it in the Rela structure.

However, since there is an existing ABI which acts differently, there
is no point.

Ian

      reply	other threads:[~1999-07-09  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-05  8:47 Jakub Jelinek
1999-07-08 15:50 ` Richard Henderson
1999-07-09  5:40   ` [PATCH] My current SPARC patches Jakub Jelinek
1999-07-16 14:34     ` Richard Henderson
1999-07-08 16:09 ` [PATCH] Support for R_SPARC_OLO10 relocations Richard Henderson
1999-07-08 20:02 ` Ian Lance Taylor
1999-07-08 23:34   ` Jakub Jelinek
1999-07-09  9:52     ` Ian Lance Taylor [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=19990709154144.7682.qmail@daffy.airs.com \
    --to=ian@zembu.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=davem@redhat.com \
    --cc=jj@sunsite.ms.mff.cuni.cz \
    /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).