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

Pierre Labastie pierre.labastie@neuf.fr
Tue Aug 30 18:53:14 GMT 2022


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...

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

Pierre Labastie


More information about the Binutils mailing list