[PATCH] Add --only-keep-debug-and-symbols option to objcopy
Nick Clifton
nickc@redhat.com
Sat Jan 10 09:32:00 GMT 2004
Hi Daniel,
>> Following patch on top of Nick's patch from yesterday adds
>> --only-keep-debug-and-symbols option which does something similar
>> to eu-strip -f foo.debug foo with the foo.debug file.
>> Particularly, it keeps debugging sections (like --only-keep-debug),
>> but also .symtab/.strtab. Allocated sections are changed into
>> SHT_NOBITS sections, so that the symbols don't have to be converted
>> into SHN_ABS symbols.
>> Ok to commit?
>
> Is there any advantage to using --only-keep-debug after this? i.e.
> should we just change the behaviour of --only-keep-debug instead?
I am still in favour of having two separate switches, on the
grounds that this would fit in with the current way that objcopy
works, and cause the least disturbance to already existing code.
It might seem like it would be simpler to just have one switch (like
"-f" in eu-strip) which does everything, including adding the
.gnu_debuglink section, stripping out the symbol tables and debug info
into a separate file and so on. My concern with this is that it will
probably require some extensive internal changes to objcopy which are
bound to introduce new bugs.
A script can be used to wrap up the entire create-a-stripped-
executable-and-separate-debug-info process, so why introduce u
necessary changes into objcopy ?
Cheers
Nick
More information about the Binutils
mailing list