[PATCH] Add --only-keep-debug-and-symbols option to objcopy

Nick Clifton nickc@redhat.com
Mon Jan 12 14:13:00 GMT 2004

Hi Jakub,

> On Sat, Jan 10, 2004 at 11:52:00AM -0500, Daniel Jacobowitz wrote:
>> I suggested changing --only-keep-debug to keep the symtab, instead of
>> adding the new option.  I can't tell if you're objecting to that, or
>> objecting to something like eu-strip -f which combines
>> --add-gnu-debuglink and --only-keep-debug-and-symbols.
> Here is a patch which does that.
> 2004-01-11  Jakub Jelinek  <jakub@redhat.com>
> 	* objcopy.c: Include elf-bfd.h.
> 	(is_strip_section): Don't strip debugging sections if
> 	(setup_section): If STRIP_NONDEBUG make SEC_ALLOC sections
> 	~(SEC_LOAD | SEC_HAS_CONTENTS) and on ELF targets also SHT_NOBITS.

Well, personally, I do not think that we need this patch, as your
--only-keep-debug-and-symbols patch will implement the same
functionality.  I am open to persuasion however, if people are
passionately in favour of it.

> 	* objcopy.c (copy_section): Free relpp if relcount == 0.

I assume that this is a bug-fix independent of the rest of the patch ?
If so then this part is approved.


More information about the Binutils mailing list