[PATCH] ld/pdb: Avoid quadratic section lookup in handle_debugs_section

Jan Beulich jbeulich@suse.com
Fri Nov 6 09:32:17 GMT 2026


On 06.11.2026 10:28, Oleg Tolmatcev wrote:
> пт, 6 нояб. 2026 г. в 10:18, Jan Beulich <jbeulich@suse.com>:
>> On 02.11.2026 23:59, Oleg Tolmatcev wrote:
>>> To map symbols to their sections, handle_debugs_section scanned all
>>> symbols once per section, for every .debug$S section.  With many
>>> sections and symbols per object, this took about half of ld's time
>>> when linking with --pdb.
>>>
>>> Use coff_section_from_bfd_index, which looks sections up in a hash
>>> table cached on the BFD.
>>>
>>> ld/
>>>       * pdb.c (handle_debugs_section): Use coff_section_from_bfd_index
>>>       to find the sections of symbols.
>>
>> Okay.
>>
>> A remark on your sending of this and the other 5 patches: If they're
>> meant to be a series, they should be numbered accordingly. A series
>> ideally would also have a cover letter. If they're not meant to be a
>> series, later patches shouldn't be replies to earlier ones.
> 
> Sorry, I forgot to add "--no-thread" to "git send-email".

Except that, now that I looked at patch 2 as well, that one depends on
patch 1 (contextually, not functionally). I haven't looked further yet.

Jan


More information about the Binutils mailing list