This is the mail archive of the binutils@sourceware.org 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: [PATCH] Reduce ARM linking time


On 03/20/2010 12:05 AM, Jie Zhang wrote:
We encountered an problem with ARM ld that the linking time of a large
application was very long, about 1.5 hour.

Forgot to mention that with this patch, that linking time of that particular application is reduced to about 30 seconds.



The root cause of this issue is ARM uses a double link list to track sections with ARM specific section data allocated. Below is the related comment:

/* Unfortunately we need to keep a list of sections for which
an _arm_elf_section_data structure has been allocated. This
is because it is possible for functions like elf32_arm_write_section
to be called on a section which has had an elf_data_structure
allocated for it (and so the used_by_bfd field is valid) but
for which the ARM extended version of this structure - the
_arm_elf_section_data structure - has not been allocated. */

When ARM specific section data for a particular section is needed, the
*whole* list is traversed to verify if that section is in the list, i.e.
it has ARM specific section data allocated. For large applications with
tens of thousands of sections, the traverse time becomes extremely long.
This was used to fix:

http://sourceware.org/bugzilla/show_bug.cgi?id=1147

This patch uses is_arm_elf, as Paul and Dan suggested, to decide if this
section has an _arm_elf_section_data. We also need to set mapcount to -1
in elf32_arm_write_section to distinguish the two cases: no mapping
symbols (mapcount == 0) vs mapping symbols have been consumed (mapcount
== 1). Otherwise, the bug mentioned in

http://sourceware.org/ml/binutils/2010-02/msg00018.html

would come out and bite us again.

Ld regression testing with arm-none-linux-gnueabi is OK.

OK to commit?



--
Jie Zhang
CodeSourcery
(650) 331-3385 x735


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