This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] elf: Always set l in _dl_init_paths (Bug 23462).
* Carlos O'Donell:
> This does not turn out to be true. And it makes sense when I think
> about it more thoroughly.
>
> The static executable, lacking a .dynamic section, does not fill in
> any of the link maps's l_info data, in fact it's all just a list of
> NULLs because there was no data to load.
Statically linked executables can have dynamic segments. However, there
seems to be a bug in BFD ld because it ignores -rpath for them.
> You would have to assemble a static binary with a .dynamic section
> and the static linker doesn't want to do that.
You can use -static-pie on some targets, then there is a dynamic
segment, and BFD ld adds DT_RPATH to it.
Thanks,
Florian