objcopy --extract-symbol option keeping bogus sections/segments : wrong?
Vincent Rubiolo
vincent.rubiolo@windriver.com
Mon Jul 2 10:55:00 GMT 2007
Hi gentle binutils maintainers,
I am writing to you about the newly added --extract-symbol of objcopy
(cf [1]) which, as Richard explained, we use to extract symbol files
from VxWorks kernels.
My concern is about the fact that the option zeroes out the
addresses/sizes, etc of the sections and segments in the file _instead_
of only keeping the relevant bits in. In some circumstances, this
confuses our kernel loader (which is used to load that stripped file)
since the segments within the file are marked as loadable but are of
empty size/address.
I have looked at the ELF spec [2] and while the standard says the image
can have supplementary segments/sections, it does not specify whether
they can be empty/marked PT_LOAD.
To me, there is no reason to have these bogus sections/segments in the
image and they should be removed. I think we should fix the file and not
the loader itself.
Is this a correct reasoning?
Thanks for your insight.
Vincent
PS: attaching readelf output on VxWorks symbol files
[1] http://sourceware.org/ml/binutils/2007-03/msg00004.html
[2] http://www.sco.com/developers/gabi/latest/contents.html
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: readelf_output
URL: <https://sourceware.org/pipermail/binutils/attachments/20070702/0e7a71c6/attachment.ksh>
More information about the Binutils
mailing list