This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Another linker performance issue


John,

> Another idea, more along the lines of different global strategy:
> Do the calls to pe_find_cdecl_alias_match() come in batches,
> such as all the symbols needing alias resolution are checked together?
> Then for each batch, build an array of pointers to the undefined symbols only.
> Run bfd_link_hash_traverse() once to just count the undefined symbols;
> allocate an array of that many pointers.  Then run bfd_link_hash_traverse()
> again, filling in the array.  Now do an entire batch of alias matching
> on the array of undefined symbols.  Then free() the array of pointers.

A bit complex, not sure it would work (I do not know well the internal
of this circuitry). When an alias is found, the corresponding hash table
is updated. So looking first for all undef then checking for alias is
not equivalent. But maybe this does not matters here, again I do not
know the internal.

I've CC Kai which has implemented this part (back in Nov 2009).

Another possible option:

It looks like we need to traverse this hash table because we are looking
for patterns like:

   _<name>@nn
or
   @_<name>@@nn

The @nn is the annoying part of course. We could maybe create a new hash
table, before the big loop in pe_process_import_defs, containing all
undefined symbols with stripped @nn. Then looking for the cdecl alias
can be done with two lookups:

   lookup ("_<name>")
   lookup ("@_<name>")

But as I said this table is updated in add_bfd_to_link (also in
pe-dll.c). So we probably want to add the new symbols into this new
table at this point. Things here is that my binutils knowledge is not
good enough to know if this is possible or not.

Kai, John, how does that sounds?

Thanks.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]