linker throws error no .eh_frame_hdr will be created

Alan Modra amodra@gmail.com
Thu Jun 3 08:58:29 GMT 2021


On Thu, Jun 03, 2021 at 02:02:46PM +0530, kamlesh kumar wrote:
> When I give executable as input in linker like below it throws error,
> but resulted binary almost contain similar section.
> $ ./build-binutils-2.36/ld/ld-new -r test.exe -o bar
> ./build-binutils-2.36/ld/ld-new: error in test.exe(.eh_frame); no
> .eh_frame_hdr table will be created

I'm a little surprised you don't get other errors too.  Trying to turn
an executable into a relocatable object like this is not supported.

If you try this with current mainline sources and an ELF executable
you'll get:
	"cannot use executable file 'test.exe' as input to a link"

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list