Apparently since this commit: 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. ld fails to build, for example, seabios, which is a bios/firmware for x86 platform and needs to have 16bit startup code. Current seabios source tarball available for download from https://www.seabios.org/downloads/seabios-1.13.0.tar.gz (it is a relatively small self-contained project), 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. Might be it is possible to change seabios in a way to not require linking an executable into executable, I dunno. The whole firmware build thing is always somewhat funny.. Thanks, /mjt
Created attachment 12689 [details] Proposed patch Hi Guys, I had not realized that a new PR had been opened, so I actually created this patch for PR 26047. Please could you give this patch a try and see if it solves the problem for you. You will need to add the (new) "-z allowexec" option to your linker command line in order for the patch to take affect. Cheers Nick