RFC: [PATCH] New attempt at fixing MIPS --gc-sections et al.

Alan Modra amodra@bigpond.net.au
Wed Aug 17 01:49:00 GMT 2005

On Tue, Aug 16, 2005 at 06:12:33PM -0700, David Daney wrote:
> I am assuming that the reason you say not to add more fields is to try 
> to minimize runtime memory usage for ld.
> Is that a correct assumption?

That's only part of the reason.  More importantly, it looks very much
like a quick hack to work around a problem that has a better solution.

> The problem I am having with marking symbols from GCed sections as 
> forced_local is that the symbols still show up in the dynamic symbol 
> table.  As expected they are marked as local, but they are still there 
> taking up space.

When I said force them local, I meant via elf_backend_hide_symbol.

Hmm, I see elf_gc_sweep_symbol won't do the right thing for shared libs,
so I'd better fix that now that we are supposed to support --gc-sections
when generating shared libs.  I think elf_gc_sweep_symbol ought to call
elf_backend_hide_symbol for symbols in removed sections, and leave the
renumbering to _bfd_elf_link_renumber_dynsyms as you do in your patch.

Alan Modra
IBM OzLabs - Linux Technology Centre

More information about the Binutils mailing list