This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] More aggressive --gc-sections
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Eric Botcazou <ebotcazou at act-europe dot fr>
- Cc: binutils at sources dot redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Mar 2004 20:34:37 +1030
- Subject: Re: [PATCH] More aggressive --gc-sections
- References: <200403180034.37251.ebotcazou@act-europe.fr>
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