public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Mark Mitchell <mark@codesourcery.com>,
	binutils@sources.redhat.com,   rdsandiford@googlemail.com
Subject: Re: Should MIPS .eh_frame be writable?
Date: Tue, 08 Sep 2009 20:24:00 -0000	[thread overview]
Message-ID: <4AA6BD82.9020802@codesourcery.com> (raw)
In-Reply-To: <8763bt1aix.fsf@firetop.home>

Richard Sandiford wrote:

>> I think it's bad if GAS marks a section as read-only when it should
>> know that it's not.  Shouldn't GAS check that it's really generating a
>> read-only frame before setting the read-only bit?
> 
> GAS doesn't know for sure, because the linker can turn absolute
> relocations into PC-relative ones.  That's how we get rid of all
> the object-local relocations on MIPS, even though the original
> code uses absolute addresses.

The linker, then, can know for sure.  The result of the current
situation is that a linker script using ONLY_IF_RO with .eh_frame
sections will end up with .eh_frame sections in the text segment, even
when there are outstanding relocations against the section.  That seems
bad.  (The good outcome is the one where the loader blows up; the bad
outcome is the one in which all your programs end up needing relocation
of the text section and you don't realize it.)

I'd suggest having GAS mark the sections read-write, and having the
linker treat them as read-only if it can eliminate the relocations.

> In summary, I think this is genuinely a GCC bug.  When using .cfi_*
> directives, it should take account of the fact that GAS will mark
> the .eh_frame section read-only.

Would you please CC: me on the patch when you put that together?

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

  reply	other threads:[~2009-09-08 20:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 14:51 Mark Mitchell
2009-09-08 18:49 ` Richard Sandiford
2009-09-08 18:59   ` Mark Mitchell
2009-09-08 19:50     ` Richard Sandiford
2009-09-08 20:24       ` Mark Mitchell [this message]
2009-09-09 21:16         ` Richard Sandiford
2009-09-09 23:44           ` Mark Mitchell
2009-09-10  7:56             ` Richard Sandiford

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=4AA6BD82.9020802@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=binutils@sources.redhat.com \
    --cc=rdsandiford@googlemail.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).