[PATCH] ld/pdb: Handle bigobj input files in handle_debugs_section
Oleg Tolmatcev
oleg.tolmatcev@gmail.com
Fri Nov 6 20:36:25 GMT 2026
пт, 6 нояб. 2026 г. в 14:07, Jan Beulich <jbeulich@suse.com>:
>
> 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
I included aarch64, but interix is already excluded by the guard at
the top of the file.
> binutils/testsuite/lib/binutils-common.exp should gain a suitable predicate,
> but that's nothing I'm going to demand doing here.)
>
> Jan
Oleg
More information about the Binutils
mailing list