This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Long link times and elf_bfd_discard_stabs
- From: Jamie Guinan <guinan at bluebutton dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 27 Oct 2003 18:41:26 -0500 (EST)
- Subject: Long link times and elf_bfd_discard_stabs
- Reply-to: guinan at bluebutton dot com
Hi,
I'm working on a project using mostly C++ which taking a very long
time to link, using mips-elf-ld from binutils-2.13.
My host platform is Linux 2.4.22, so I was able to use oprofile,
and easily find what's taking so much time:
vma samples % symbol name
08087384 21440225 81.8378 _bfd_elf32_reloc_symbol_deleted_p
080503ec 3260410 12.4451 print_one_symbol
080642d8 412356 1.5740 bfd_hash_traverse
0804e914 190403 0.7268 lang_output_section_find
The "deleting discardable stabs" patch was added almost 2 years ago,
http://sources.redhat.com/ml/binutils/2001-11/msg00305.html
My questions:
It looks like it is just trying to mop up unused debugging symbols, is
that right?
Are they harmless if I leave them in there?
In that case, can I safely disable this by going back to
${LDEMUL_FINISH-NULL} in elf32.em?
When I do this, my link time drops from 90 seconds to 4 seconds on
a 3GHz P4.
Details (fwiw): the project is about 700 C++ modules, cross-compiled
with mips-elf-gcc 3.2.3, and most if it is partially linked (-r)
before the final link.
Thanks,
-Jamie