public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard@codesourcery.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: David Daney <ddaney@avtrex.com>,
	ligang@sunnorth.com.cn,   binutils@sourceware.org
Subject: Re: mips multi-got error
Date: Wed, 05 Jul 2006 07:52:00 -0000	[thread overview]
Message-ID: <87sllgmqu4.fsf@talisman.home> (raw)
In-Reply-To: <20060630133009.GA21946@networkno.de> (Thiemo Seufer's message of 	"Fri, 30 Jun 2006 14:30:09 +0100")

Thiemo Seufer <ths@networkno.de> writes:
> David Daney wrote:
>> Thiemo Seufer wrote:
>> >David Daney wrote:
>> >[snip]
>> >
>> >>That is not supposed to work.  Multi-got linking only works if there are 
>> >>fewer than 8192 symbols per compilation unit (input .o to the linker). 
>> >>See the multi-got-1 testcase in ld/testsuite/ld-mips-elf.
>> >>
>> >>If you need more than 8192 symbols per compilation unit you must use 
>> >>-xgot for the assembler.  Recent GCC versions have a -mxgot option that 
>> >>does the same thing for GCC.
>> >
>> >
>> >Actually, it is supposed to work. :-)  It is also a known deficiency
>> >in the current assembler/linker implementation.

David's surely right here.  It isn't _supposed_ to work.  You might
be able to invent new schemes that allow it to work, but it won't
work with the current scheme.

>> How?
>> 
>> The gp is set in the function prolog.  If a single function references 
>> more got/plt entries than can be indexed with a 16 bit offset, wouldn't 
>> you need to either load the gp before each got access(very inefficient I 
>> would think) or use a 32 bit offset (somewhat inefficient)?
>
> It doesn't need a gp load before each access, one per 16-bit addressable
> GOT block would be enough. (This implies a Multi-GOT extension for
> relocatable object files, probably with gp0..gpN / _gp_disp0.._gp_dispN
> as per-GOT symbols.)

But how would you know which _gp_dispN applied to a given GOT relocation?
I hope it wouldn't be by comparing relocation field addresses.

Richard

      reply	other threads:[~2006-07-05  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-28 11:32 ligang
2006-06-28 17:09 ` David Daney
2006-06-28 17:30   ` Thiemo Seufer
2006-06-28 18:45     ` David Daney
2006-06-30 13:35       ` Thiemo Seufer
2006-07-05  7:52         ` Richard Sandiford [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=87sllgmqu4.fsf@talisman.home \
    --to=richard@codesourcery.com \
    --cc=binutils@sourceware.org \
    --cc=ddaney@avtrex.com \
    --cc=ligang@sunnorth.com.cn \
    --cc=ths@networkno.de \
    /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).