This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: performance problem when linking for windows
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jeff Epler <jepler at unpythonic dot net>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 15 Jun 2005 12:28:19 +0930
- Subject: Re: performance problem when linking for windows
- References: <20050610200428.GC6998@unpythonic.net>
On Fri, Jun 10, 2005 at 03:04:28PM -0500, Jeff Epler wrote:
> The Linux binary takes under 1 CPU minute to link, while the Windows
> binary can take around 8 CPU minutes to link. I notice that the RAM
> usage for the link of the .EXE is much lower (less than 200 megs instead
> of nearly 1 gigabyte)
I don't know why the difference in memory, but if you profiled ld when
linking the linux ELF output you'd see quite a different profile to that
for your windows PE output. With PE, wild_sort and compare_section are
high on the list because the PE linker script uses SORT() a lot.
> Does anyone have some advice on where I might look to speed this up?
Rewrite ld's SORT() handling to use something better than insertion
sort. Look at the ld info file to find the semantics of various linker
script constructs, and start at ldlang.c:map_input_to_output_sections to
figure out the current implementation.
--
Alan Modra
IBM OzLabs - Linux Technology Centre