This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC PATCH] pad out code segment for NaCl targets
- From: Roland McGrath <mcgrathr at google dot com>
- To: Roland McGrath <mcgrathr at google dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 15 Aug 2013 16:22:31 -0700
- Subject: Re: [RFC PATCH] pad out code segment for NaCl targets
- References: <CAB=4xhoo--ZQNgJapor=uXo3TvLMDtZWuHtr6dBD62sSdXMNwg at mail dot gmail dot com> <20130810075123 dot GY3294 at bubble dot grove dot modra dot org>
On Sat, Aug 10, 2013 at 12:51 AM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Aug 08, 2013 at 02:17:04PM -0700, Roland McGrath wrote:
>> I've figured out a way to make this happen, but I'm not very happy with it.
>> I hope someone can recommend a different approach that will serve me better.
>
> elf_backend_final_write_processing perhaps?
Clearly I could write out the fill regions there. But that is too late to
adjust offsets for the parts of the file that come after a code segment
(and thus need to be pushed out to the next page boundary), isn't it?
In the normal NaCl layout, there is one code segment and it comes last in
the file, so only non-allocated sections and shdrs come after it. AFAIK
the shdrs themselves are the only things that I could actually move this
late. Even if I could move the non-allocated sections (including
.shstrtab) too, I don't think I'd want to make the logic assume that there
is only one code segment and that it is last in the file.
Can you elaborate on your suggestion?
Thanks,
Roland