[PATCH] More aggressive --gc-sections
Alan Modra
amodra@bigpond.net.au
Thu Mar 18 10:04:00 GMT 2004
On Thu, Mar 18, 2004 at 12:40:25AM +0100, Eric Botcazou wrote:
> * elflink.h (elf_gc_mark_dynamic_ref_symbol): New function.
> (elf_gc_sections): Do not gracefully fail if dynamic sections have
> been created. Instead call elf_gc_mark_dynamic_ref_symbol to
> mark dynamically referenced symbols. Do not mark the whole graph
> rooted at .eh_frame, only the section proper.
Have you tested this when building shared libs? I suspect that
elf_gc_mark_dynamic_ref_symbol won't do the right thing for shared libs,
specifically, that ELF_LINK_HASH_REF_DYNAMIC won't always be set. You
will probably want to disable gc-sections for shared libs.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list