[RFD] New binutil 'objsplit'

Ian Lance Taylor ian@wasabisystems.com
Wed Apr 21 17:58:00 GMT 2004


"Dave Korn" <dk@artimi.com> writes:

> 1)  First and foremost, does anyone think this functionality might be of any
> interest or use to anyone except me?

I don't know.  I guess my question is: why don't we implement
-gc-sections more widely?  It seems to me that we can use generic
mark_hook and sweep_hook functions for most ELF backends, particularly
most small embedded ELF backends.  Why not go that route?  What else
do we need?

> 2)  I don't know if any of this matters for non-ELF files; it may well be
> the case that for simpler formats (eg COFF or AOUT) "objcopy --keep-section"
> would indeed DTRT.  Does anyone else know off the top of their head?

The issue does not really arise for a.out, which only supports three
sections, one of which can not have any contents.

I think that for COFF things are simpler, but nonetheless I doubt that
--keep-section will reliably work for what you want.

> 3)  Should it be reintegrated into objcopy, as a new option, rather than
> implemented as an entire new tool?  It would be possible, certainly, but I
> feel that a) objcopy is overloaded enough as it is, and b) a copy should be
> a one-to-one operation and this is a one-to-many, so it doesn't really fit
> the same conceptual scheme.

Since the output is many .o files, I don't think this should be
implemented within objcopy.

> 4)  Or should I integrate it into ar, despite the fact that doing so would
> basically involve large chunks of code duplication from objcopy into ar (all
> the symbol table gc mechanics, frex) with all the grief that implies.  [ Can
> you tell I don't like this idea?! ]

No, yuck.

Ian



More information about the Binutils mailing list