recent ld built for x86_64 fails to accept 16bit code as input (seabios build)

H.J. Lu hjl.tools@gmail.com
Thu Jul 9 14:47:42 GMT 2020


On Thu, Jul 9, 2020 at 7:40 AM Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> Hello!
>
> To clarify from the very beginning, I don't know how this part of the
> larger picture actually works.  The end result is that seabios project,
> with the current source tarball available for download from
> https://www.seabios.org/downloads/seabios-1.13.0.tar.gz ,
> can't be built using GNU ld as of version 2.34.90.20200706.
>
> Here's the relevant output:
>
> seabios-1.13.0 $ make silentoldconfig
> seabios-1.13.0 $ make V=1 PYTHON=python3
> ...
>   Linking out/rom16.o
> ld -T out/romlayout16.lds out/code16.o -o out/rom16.o
>   Stripping out/rom16.strip.o
> strip out/rom16.o -o out/rom16.strip.o
>   Linking out/rom.o
> ld -N -T out/romlayout32flat.lds out/rom16.strip.o out/rom32seg.strip.o out/code32flat.o -o out/rom.o
> ld: cannot use executable file 'out/rom16.strip.o' as input to a link
> make: *** [Makefile:187: out/rom.o] Error 1
> seabios-1.13.0 $ _
>
> Previous versions of ld accepted this file just fine
> and produced valid out/bios.bin in the end.
>
> I dunno if this is a problem is seabios (which has actually
> been already reported to seabios by Paul Menzel today), or
> an issue in ld. These ROMs/firmwares are a bit tricky to build..
>

It was caused by:

commit a87e1817a435dab6c6c042f9306497c9f13d4236
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu May 28 17:43:21 2020 +0100

    Have the linker fail if any attempt to link in an executable is made.

            PR 26047
            * ldelf.c (ldelf_after_open): Fail if attempting to link one
            executable into another.  Ensure that the test is made for all
            forms of linking.

Please open a binutils regression bug against 2.35.

-- 
H.J.


More information about the Binutils mailing list