This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Improvements to section to segment mapping
- To: ian at zembu dot com
- Subject: Re: Improvements to section to segment mapping
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Fri, 28 Jul 2000 13:23:22 -0700
- CC: binutils at sourceware dot cygnus dot com
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