This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/3111: LD very slow linking object files containing dwarf2 symbols
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 19 Jan 2007 16:20:19 +0100
- Subject: Re: PATCH: PR ld/3111: LD very slow linking object files containing dwarf2 symbols
- References: <20060829230012.GA19841@lucon.org> <20070119144609.GI3819@sunsite.mff.cuni.cz> <20070119150524.GJ3819@sunsite.mff.cuni.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jan 19, 2007 at 04:05:24PM +0100, Jakub Jelinek wrote:
> On Fri, Jan 19, 2007 at 03:46:09PM +0100, Jakub Jelinek wrote:
> > I wonder if we can't combine the benefits of both approaches.
>
> If we keep your symbuf arrays per-bfd rather than per-section,
> then either we don't sort the symbols at all and just
> do what my patch is doing, linearly scanning all isyms to pick
> the ones for current section (which can be worst case twice slower
> than the current search), or we can e.g.
> avoid putting SHN_UNDEF symbols into the symbuf array altogether
> and sort the rest just based on shndx (no ELF_ST_BIND sorting)
> through an indirection (qsorting array of integers or array
> of pointers is far cheaper than qsorting array of 32 byte structures).
> But then we should use a binary search rather than scan linearly.
BTW, unless you plan to reuse elf_tdata (bfd)->symbuf in some other
place, bfd_elf_match_symbols_in_sections only ever looks at
st_info, st_other, st_shndx st_name of the internal symbols.
So to save memory, you can very well also just save that data and
nothing else (nor the undef symbols and save more than 50% of memory on
this).
Jakub