Objcopy problem

Daniel Jacobowitz drow@false.org
Tue Oct 30 15:58:00 GMT 2007


On Tue, Oct 30, 2007 at 02:48:11PM +0000, Andrew STUBBS wrote:
> As you can see, the section now _has_ a file size. This was the point of the 
> exercise - the section contents may now be overwritten with the final data (in 
> this case a digital signature used to verify the other sections).

Objdump provides a slightly fuzzy, malleable view of an object file.
Readelf is more precise, and useful in these cases.

The question is, where do those bits go, and what has to move to fit
them?  I think it's possible to change the alloc flag in a linked
file, since only file offsets change, but it may be a bit tricky.

> The linker will not allow us to create a loadable section for which we do not 
> yet know the contents.

Sure it will.  Just zero-fill it, and then set its contents later -
you know the size of the signature, right?  You can just use .space.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list