question: i386 ld.gold reports "internal error" linking files with SHT_RELA section

H.J. Lu hjl.tools@gmail.com
Tue Aug 30 20:36:34 GMT 2022


On Tue, Aug 30, 2022 at 11:53 AM Pierre Labastie
<pierre.labastie@neuf.fr> wrote:
>
> On Tue, 2022-08-30 at 11:21 -0700, H.J. Lu wrote:
> > On Tue, Aug 30, 2022 at 7:39 AM Xi Ruoyao via Binutils
> > <binutils@sourceware.org> wrote:
> > >
> > > Building SeaMonkey on i686 results:
> > >
> > >     "/usr/bin/ld.gold: internal error in relocate_section, at
> > > ../../gold/i386.cc:3683"
> > >
> > > i386.cc:3683 is:
> > >
> > >     gold_assert(sh_type == elfcpp::SHT_REL);
> > >
> > > AFAIK i386 normally use SHT_REL and x86_64 normally use SHT_RELA.  But
> > > we've found that nasm-2.15.05 generates SHT_RELA for i386 as well.
> > >
> > > So should SHT_RELA be allowed for i386 at all?  If "yes" we should fix
> > > it for gold, if "no" we should fix it for nasm.
> > > --
> > > Xi Ruoyao <xry111@xry111.site>
> > > School of Aerospace Science and Technology, Xidian University
> >
> >  SHT_RELA shouldn't be used for i386.
> >
>
> But it is accepted by ld.bfd...

Do you have .o files for ld.bfd I can take a look at?

> FWIIW, only the dwarf debug sections are generated as SHT_RELA by nasm.
>
> Pierre Labastie



-- 
H.J.


More information about the Binutils mailing list