Small? request for ld --gc-sections

Alan Modra amodra@bigpond.net.au
Wed Aug 15 14:40:00 GMT 2001


On Wed, Aug 15, 2001 at 05:57:14PM +0200, Etienne Lorrain wrote:
> 
>  I have at the end of my linker file:
> library_sprintf = sprintf ;
>  And in one configuration, the symbol "library_sprintf" is not used,
>  "sprintf" is not used neither, but the function "sprintf" is included
>  in the link (ld --gc-section) because of this linker line.

I can't reproduce this behaviour. ie. I can reference a function in the
linker script via an assignment, and have the function removed.  Are you
sure garbage collection is being done at all?  Note that if linking
against a shared lib, gc won't run.

Mon Oct  5 10:06:22 1998  Catherine Moore  <clm@cygnus.com>

	* elflink.h (elf_gc_sections):  Do not allow garbage
	collection if dynamic sections have been created.

I'm not sure why there is this restriction.  Catherine?

Alan



More information about the Binutils mailing list