This is the mail archive of the
mailing list for the GCC 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: <firstname.lastname@example.org>
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.
IBM OzLabs - Linux Technology Centre