This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: performance problem when linking for windows


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]