[PATCH] ld/pdb: Handle bigobj input files in handle_debugs_section

Jan Beulich jbeulich@suse.com
Fri Nov 6 13:07:25 GMT 2026


On 02.11.2026 23:59, Oleg Tolmatcev wrote:
> --- a/ld/pdb.c
> +++ b/ld/pdb.c
> @@ -1940,20 +1940,22 @@ handle_debugs_section (asection *s, bfd *mod, struct string_table *strings,
>        struct internal_syment *symbols;
>        asection **sectlist;
>        unsigned int syment_count;
> -      struct external_syment *ext;
> +      bfd_byte *ext;
> +      bfd_size_type symesz;
>  
>        syment_count = obj_raw_syment_count (mod);
> +      symesz = bfd_coff_symesz (mod);

Can't this be the initializer of the variable?

>        relocs = bfd_coff_read_internal_relocs (mod, s, false, NULL, true, NULL);
>  
>        symbols = xmalloc (sizeof (struct internal_syment) * syment_count);
>        sectlist = xmalloc (sizeof (asection *) * syment_count);
>  
> -      ext = (struct external_syment *) (coff_data (mod)->external_syms);
> +      ext = (bfd_byte *) coff_data (mod)->external_syms;

Same here, perhaps. Additionally there's no need for a cast here (we're
trying to get rid of such unnecessary casts as we touch code).

> @@ -1862,7 +1868,10 @@ proc test11 { } {
>  test1
>  test2
>  test3
> -test4
> +test4 ""
> +if { [istarget i*86-*-*] || [istarget x86_64-*-*] } {
> +    test4 "-mbig-obj"
> +}

Judging from gas/testsuite/gas/pe/pe.exp aarch64 may want including here,
and interix may need excluding. (Perhaps
binutils/testsuite/lib/binutils-common.exp should gain a suitable predicate,
but that's nothing I'm going to demand doing here.)

Jan


More information about the Binutils mailing list