[PATCH] ld/pdb: Skip auxiliary symbol entries in handle_debugs_section

Jan Beulich jbeulich@suse.com
Fri Nov 6 09:28:43 GMT 2026


On 02.11.2026 23:59, Oleg Tolmatcev wrote:
> handle_debugs_section treated every raw symbol table entry, including
> auxiliary entries, as a symbol and looked up a section for its n_scnum.
> In auxiliary entries that field holds unrelated data, so the lookup
> often missed and fell back to a linear scan over all sections.  With
> objects containing thousands of sections this took about 10% of the
> link time for a large executable with --pdb.
> 
> ld/
> 	* pdb.c (handle_debugs_section): Skip auxiliary symbol entries.

Okay, with one nit:

> --- a/ld/pdb.c
> +++ b/ld/pdb.c
> @@ -1956,6 +1956,7 @@ handle_debugs_section (asection *s, bfd *mod, struct string_table *strings,
>  	  bfd_coff_swap_sym_in (mod, &ext[i], &symbols[i]);
>  	  if (symbols[i].n_scnum > 0)
>  	    sectlist[i] = coff_section_from_bfd_index (mod, symbols[i].n_scnum);
> +	  i += symbols[i].n_numaux;
>  	}

As we're adding more stuff there, separating blank lines will become
helpful. I'll add one in patch 1 and another one here.

Jan


More information about the Binutils mailing list