Hi, I have a large (~200MB) C++ shared library that links in a very reasonable 15 CPU sec. using older versions of ld (such as "2.15.92.0.2" from Red Hat Enterprise 4, or "2.15.90.0.1.1" from SuSE Enterprise 9), but with "2.16.91.0.5" 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 http://sourceware.org/bugzilla/show_bug.cgi?id=3321 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils