Improvements to section to segment mapping

Nick Clifton nickc@cygnus.com
Fri Jul 28 13:23:00 GMT 2000


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



More information about the Binutils mailing list