[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/3321] New: ld slow linking large C++ shared library

From: Scott at ergy dot com
Subject: [Bug ld/3321] New: ld slow linking large C++ shared library
Date: 8 Oct 2006 23:37:17 -0000


I have a large (~200MB) C++ shared library that links in a very reasonable 15
CPU sec. using older versions of ld (such as "" from Red Hat
Enterprise 4, or "" from SuSE Enterprise 9), but with ""
from SuSE Enterprise 10 and also a stock 2.17, takes more than 10 CPU minutes.

The vast majority of the time is being spent on the following call chain:

elf_link_input_bfd (bfd/elflink.c: 7155)
_bfd_elf_check_kept_section (bfd/elflink.c: 6802)
match_group_member (bfd/elflink.c: 6778)
bfd_elf_match_symbols_in_sections (bfd/elf.c: 8629)
qsort and callees

I tried #if-ing out the statement in `elf_link_input_bfd' beginning with `if
(action & PRETEND)', and the link time is back down to ~25 CPU sec.  The comment
above that statement suggests that it may not be necessary with a recent GCC
anyway.  I built the whole application this way and it seems to work fine, so
this seems to be an adequate temporary workaround.

As far as a real fix, I'm thinking maybe to add a member `checked_kept_section'
to `struct bfd_section' that `_bfd_elf_check_kept_section' could cache its
result in.  Haven't tried this, though.

           Summary: ld slow linking large C++ shared library
           Product: binutils
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: Scott at ergy dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64-linux
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]