Unable to give executable as input

Fangrui Song i@maskray.me
Tue May 25 06:15:53 GMT 2021


On 2021-05-25, kamlesh kumar via Binutils wrote:
>Hi All,
>2.36 version linker(ld) was accepting executable as input but now with
>trunk, it no longer works, and getting below warning/error.
>$./build-binutils-gdb/ld/ld-new -r test -o test.o
>./build-binutils-gdb/ld/ld-new: cannot use executable file 'test' as
>input to a link
>Can someone give some insight why this behavior was enforced?
>
>Nick,
>Here(https://sourceware.org/bugzilla/show_bug.cgi?id=26047#c5) you
>suggested having -z allowexec option, can we still have it?
>
>
>./kamlesh

A linked image can have many sections which make no sense to a
subsequent link. Do you have a legitimate use case that ET_EXEC input is
handy? This should be balanced with the maintenance cost adding -z
allowexec.


More information about the Binutils mailing list