public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: Daniel Jacobowitz <drow@false.org>,  binutils@sourceware.org
Subject: Re: MIPS textrel fix
Date: Fri, 19 May 2006 09:26:00 -0000	[thread overview]
Message-ID: <446D11C7.2040008@avtrex.com> (raw)
In-Reply-To: <20060519001101.GA1073@networkno.de>

Thiemo Seufer wrote:
> David Daney wrote:
> 
>>Daniel Jacobowitz wrote:
>>
>>>While stuck offline earlier today, I revisited the textrel-1 MIPS
>>>failure.  Eric originally tried setting DF_TEXTREL during section
>>>relocation, but it's too late: we add the entry in size_dynamic_sections.
>>>But I couldn't see any other way to get it right, since there's no
>>>hook to predict whether elf-eh-frame.c will eliminate a relocation.
>>>
>>>The easiest approach I found was to annul the DT_TEXTREL and DT_FLAGS
>>>changes in finish_dynamic_sections if no text relocations were
>>>actually generated.  This is not immensely pretty, but does work.
>>>OK?
>>>
>>>For background, the problem arises from the use of absolute addresses
>>>in .eh_frame.  In this case, they're being produced by gas CFI
>>>directives.  Is there a reason we can't mix and match encodings?
>>>i.e. why not have gas use a PC-relative format?  I'm sure there's
>>>a reason, but I can't think of it...
>>>
>>
>>Could it be related to the reason that GCC no longer generates a 
>>PC-relative .eh_frame?
>>
>>I never fully understood the reason, but I think it has to do with 
>>MIPS-ELF specifications not allowing the needed relocation types (even 
>>though they work well in binutils/glibc/linux).
> 
> 
> The needed relocation types were originally defined for embedded PIC
> MIPS and are not available in the ABI spec, their use for eh_frame
> was an accident. When the removal of embedded PIC support broke the
> toolchain, the fix chosen was to become ABI compatible again.
> 

Not to beat a dead horse, but it would be nice to have a gnu extension 
that allows us to have read-only eh_frame sections.  Large C++ shared 
libraries have way to many relocations.  It is a lot of dirty pages in 
the name of ABI compliance.

David Daney.

  reply	other threads:[~2006-05-19  0:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-19  0:37 Daniel Jacobowitz
2006-05-19  0:50 ` Daniel Jacobowitz
2006-05-19  6:09 ` Eric Christopher
2006-05-19  9:03 ` David Daney
2006-05-19  9:12   ` Thiemo Seufer
2006-05-19  9:26     ` David Daney [this message]
2006-05-19 10:18       ` Eric Christopher
2006-05-22 20:28     ` Daniel Jacobowitz
2006-05-22 20:28       ` Thiemo Seufer

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=446D11C7.2040008@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=binutils@sourceware.org \
    --cc=drow@false.org \
    --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).