Performance issue with GNU/ld and DLL

Pascal Obry pascal@obry.net
Thu Feb 9 18:31:00 GMT 2012
Nick,

First thanks for your answer.

I have identified the slowness. This is because in pe-dll.c we have:

<<
static int
auto_export (bfd *abfd, def_file *d, const char *n)
{
  int i;
  struct exclude_list_struct *ex;
  const autofilter_entry_type *afptr;
  const char * libname = 0;
  if (abfd && abfd->my_archive)
    libname = lbasename (abfd->my_archive->filename);

  for (i = 0; i < d->num_exports; i++)
    if (strcmp (d->exports[i].name, n) == 0)
      return 0;
  ...
>>

Removing the above loop the code runs has fast for building executable
than for building DLL. Just looking at the code it is clear that we have
an O(n²) performance issue. For each export we look at all currently
exports to see if it has not yet been handled!

A solution would be to use a hash table or something like that. What
would you advise (I do not know well the binutils sources), I'm willing
to try fixing this issue.

Thanks,
Pascal.

-- 

--|------------------------------------------------------
--| 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



More information about the Binutils mailing list