[PATCH v6 5/5] elf: Allow RPATH/RUNPATH for static-pie

Florian Weimer fweimer@redhat.com
Tue Feb 3 17:37:23 GMT 2026


* Adhemerval Zanella:

> The initial static-pie support (commit 9d7a3741c9e59eba87fb) reused
> ld.so ELF parsing logic, even though RPATH/RUNPATH should not appear
> in the static-pie bootstrap.  With static PIE, RPATH/RUNPATH on the
> loader typically indicates a toolchain misconfiguration.  However,
> for static PIE, the presence of RPATH/RUNPATH has no impact because
> these binaries do not use dynamic linking at runtime.
>
> Static binaries do not support rpath because they lack dynamic
> sections, and adding static-pie support affects only the dlopen
> function. If static dlopen support is removed, this change has no effect.
>
> This change also simplifies elf_get_dynamic_info and removes a
> difference between dynamic and static binaries.
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu.
> Reviewed-by: Florian Weimer <fweimer@redhat.com>

Also missing blank line.

Thanks,
Florian



More information about the Libc-alpha mailing list