This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Improvements to section to segment mapping


Hi Ian,

:      It also allows new segments to be created, even beyond the number
:      originally estimated in ihdr->e_phnum.  It adjusts the appropriate
:      fields if it had to generate extra segments.
: 
: I haven't looked at the patch, but I don't see how this can work.
: Doesn't that break SIZEOF_HEADERS?

Yes and no.

The code only creates extra segments if they are really needed.  So in
most situations, if SIZEOF_HEADERS is used, the guess it makes will be
accurate.  If however it was wrong, then the check in
assign_file_positions_for_segments() will be triggered, issuing the
'Not enough room for program headers' error message.

This is not new behavior and my code for creating new segments should
only really be triggered if objcopy has been used to muck about with
the locations of the sections within the executable.

Cheers
	Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]