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

Jan Beulich jbeulich@suse.com
Fri Nov 6 09:18:44 GMT 2026


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.

Jan


More information about the Binutils mailing list