RFC: Default to a start address of zero for shared libraries
Fangrui Song
i@maskray.me
Fri Sep 17 23:31:42 GMT 2021
On 2021-09-18, Alan Modra via Binutils wrote:
>On Fri, Sep 17, 2021 at 05:20:33PM +0100, Nick Clifton via Binutils wrote:
>> The point of this is that it then makes it easier for the loader to
>> detect mistaken attempts by users to run shared objects.
>
>Have you tried a glibc build? glibc ld.so is a shared object that is
>supposed to be runnable.
>
>$ elf/ld.so --help
>Usage: elf/ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
>You have invoked 'ld.so', the program interpreter for dynamically-linked
>[snip]
In glibc, elf/librtld.os is linked into ld.so.
elf/librtld.os defines _start, therefore glibc is unaffected.
For ld.lld, I'll just be more aggressive and remove the .text fallback
for all modes (including executables) :)
More information about the Binutils
mailing list