Default entry point for ELF shared objects

Florian Weimer fweimer@redhat.com
Mon Sep 13 07:55:39 GMT 2021


BFD ld currently sets a non-zero entry point address for ELF shared
objects even if the object does not have a _start symbol.

Is there a reason for this behavior (particularly for ELF ET_DYN
output)?

On Linux, the kernel will happily load and execute shared objects using
this entry point address, typically leading to crashes.

If the entry point address in the ELF header were zero, it might be
possible to detect the missing entry point, and refuse to execute the
shared object as if it were a program.

Thanks,
Florian



More information about the Binutils mailing list