PATCH [v2]: makes --gc-sections compatible with -r/-q

Tristan Gingold gingold@adacore.com
Fri Jan 11 10:50:00 GMT 2008


On Jan 10, 2008, at 2:12 AM, Alan Modra wrote:

> On Wed, Jan 09, 2008 at 04:48:58PM +0100, Tristan Gingold wrote:
>> * makes all gc_sweep_hook coherent with check_relocs (ie exit
>> immediately if -r)
>
> That looks better, but please explain why you omitted elf32-bfin.c and
> elf64-mmix.c.  I'm not saying you are wrong in this (bfin is fairly
> obviously ok), but I'd like confirmation that you at least looked at
> these targets..

Yes, I looked at these two targets too.  But their current behavior  
seems OK.

>> * --gc-section -r requires a non-default entry point
>> * document in --gc-section the use of -e
>
> Does forcing the use of -e really make sense?  What if I'm using
> -r --gc-sections on an object file and wish to keep two functions and
> everything they depend on?  Wouldn't -u be a more natural option to
> use in that case?  Hmm, I guess a warning or error would be useful if
> neither -e or -u is specified.

Good point.  Requiring -e, -u or ENTRY when --gc-sections -r seems to  
be a better
policy.  I will update my patch.

Thank you for your comments and for improving the documentation.



More information about the Binutils mailing list