[RFC PATCH] pad out code segment for NaCl targets

Roland McGrath mcgrathr@google.com
Fri Aug 16 16:50:00 GMT 2013


On Fri, Aug 16, 2013 at 3:21 AM, Alan Modra <amodra@gmail.com> wrote:
> Ah, yes, you need to somehow page align any following sections before
> assign_file_positions_for_{non_,}load_sections is called.  That could
> be done in the linker script without a new padding section.

Sorry, I don't follow.  The next section in the address space is already
page-aligned (and far away).  I don't see how that helps.  The partial page
I'm concerned with is at the end of the code segment.  Because of the
machinations in bfd/elf-nacl.c, that is at the end of the file (despite not
being the highest-addressed segment).  What I need is for that segment to
extend to the next page boundary in the file, so that the non-allocated
sections (and shdrs) that follow start on the page boundary.

Perhaps I can have the modify_segment_map hook synthesize a fake section
that isn't really there or something.  I'll play with that while I wait for
a better suggestion.


Thanks,
Roland



More information about the Binutils mailing list