[PATCH] ld: Fix elf_x86_64 and elf_i386 emulations for Solaris x86

H.J. Lu hjl.tools@gmail.com
Thu Sep 4 19:36:41 GMT 2025


On Thu, Sep 4, 2025 at 12:25 PM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi H.J.,
>
> > Linkers configured for i[3-7]86-*-solaris2* and x86_64-*-solaris2* report:
> >
> > $ ./ld-new -V
> > GNU ld (GNU Binutils) 2.45.50.20250904
> >   Supported emulations:
> >    elf_x86_64_sol2
> >    elf_x86_64
> >    elf_i386_sol2
> >    elf_i386_ldso
> >    elf_i386
> >    elf_iamcu
> >
> > However, elf_x86_64 and elf_i386 emulations aren't really working:
> >
> > $ ./ld-new -melf_x86_64 -shared x.o
> > ./ld-new: target elf64-x86-64 not found
> > ...
> > $ ./ld-new -melf_i386 -shared x.o
> > ./ld-new: target elf32-i386 not found
> > $
> >
> > Fix it by adding i386_elf32_vec and x86_64_elf64_vec to Solaris x86
> > linkers.
>
> I need to test this first (and if it really works, Solaris/SPARC needs
> the same treatment.  However, I recall that we had something like this
> initially, but it didn't work because target detection didn't work
> anymore because of the ambiguity between elf32-i386 and elf32-i386-sol2.

That is a possibility.   Or we can drop elf_x86_64 and elf_i386 from
"ld -V".

> Have you even tested this patch?  There are Solaris/x86 and
> Solaris/SPARC systems in the cfarm...
>
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University



-- 
H.J.


More information about the Binutils mailing list