This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Drop undefined local symbols from symtab?
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 18 Feb 2015 23:18:47 +1030
- Subject: Re: Drop undefined local symbols from symtab?
- Authentication-results: sourceware.org; auth=none
- References: <20150218112716 dot GB11515 at bubble dot grove dot modra dot org> <CAMe9rOrmkRVcL=5f22w27K-_McASLHhxwjZ-XyyMfTsbWr32cQ at mail dot gmail dot com>
On Wed, Feb 18, 2015 at 03:34:43AM -0800, H.J. Lu wrote:
> On Wed, Feb 18, 2015 at 3:27 AM, Alan Modra <amodra@gmail.com> wrote:
> > Does anyone see any harm in dropping undefined local symbols from
> > .symtab? I've been meaning to do this for a while, mainly to get rid
> > of undefined ppc64 "dot-symbols".
> >
> > diff --git a/bfd/ChangeLog b/bfd/ChangeLog
> > index 44fc2bb..138c4ba 100644
> > --- a/bfd/ChangeLog
> > +++ b/bfd/ChangeLog
> > @@ -1,3 +1,8 @@
> > +2015-02-18 Alan Modra <amodra@gmail.com>
> > +
> > + * elflink.c (elf_link_input_bfd): Drop undefined local syms.
> > + (elf_link_output_extsym): Likewise. Tidy. Expand comment.
> > +
> > 2015-02-17 Alan Modra <amodra@gmail.com>
>
> Can you also strip undefined global symbols:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=4317
Probably. I'll take a look tomorrow. Most likely just a matter of
replacing the ELF_ST_BIND test in my elf_link_output_extsym change
with a test of !flinfo->info->relocatable. And perhaps arranging to
only strip from .symtab if the sym isn't emitted to .dynsym.
--
Alan Modra
Australia Development Lab, IBM