[PATCH 0/5] elf: Allow RPATH/RUNPATH for static-pie (BZ 33326)
Adhemerval Zanella
adhemerval.zanella@linaro.org
Fri Aug 29 19:53:20 GMT 2025
Although static binaries do not support rpath (since they lack dynamic
sections), adding static-pie support only affects the dlopen function.
It is one less unexpected behavior (where dynamic and static binaries
support and behave differently), and if/when static dlopen support is
removed, this will become a no-op.
The testcase from BZ 33236 triggered a deep issue with an assert in
startup code, which required changes to multiple ABIs to properly fix
(even though the assert itself was removed in the last patch). There
are still other assert usage, although most, if not all, are for
ill-formatted ELF files.
Adhemerval Zanella (5):
string: Add fallback implementation for ctz/clz
nptl: Add __pthread_kill_self
Use _dl_writev on __libc_message_impl
Fix assert during static startup
elf: Allow RPATH/RUNPATH for static-pie (BZ 33326)
assert/Makefile | 5 ++
elf/Makefile | 24 ++++++
elf/dl-load.c | 2 +-
elf/dl-reloc-static-pie.c | 2 +-
elf/get-dynamic-info.h | 5 +-
elf/rtld.c | 4 +-
elf/setup-vdso.h | 2 +-
elf/tst-assert-startup-static.c | 35 +++++++++
elf/tst-pie-rpath-mod.c | 19 +++++
elf/tst-pie-rpath-static.c | 53 ++++++++++++++
include/pthread.h | 1 +
libio/Makefile | 5 ++
nptl/Makefile | 6 ++
nptl/pthread_kill.c | 15 +---
nptl/pthread_kill_self.c | 39 ++++++++++
signal/Makefile | 5 ++
stdlib/Makefile | 5 ++
string/Makefile | 1 +
.../aarch64/multiarch/dl-symbol-redir-ifunc.h | 2 +
sysdeps/aarch64/multiarch/memcpy_generic.S | 4 +
sysdeps/aarch64/multiarch/strlen_generic.S | 4 +
.../linux/libc_fatal.c => generic/dl-mmap.h} | 30 ++++----
{elf => sysdeps/generic}/dl-writev.h | 18 ++---
sysdeps/generic/math-use-builtins-bitops.h | 2 +
sysdeps/generic/string-fzi.h | 73 +++++++++++++++++--
.../lp64/multiarch/dl-symbol-redir-ifunc.h | 3 +
sysdeps/posix/libc_fatal.c | 27 ++++---
sysdeps/posix/raise.c | 2 +-
.../be/multiarch/dl-symbol-redir-ifunc.h | 27 +++++++
.../le/multiarch/dl-symbol-redir-ifunc.h | 1 +
sysdeps/powerpc/powerpc64/multiarch/Makefile | 1 +
sysdeps/s390/Makefile | 5 ++
sysdeps/s390/fpu/math-use-builtins-bitops.h | 7 ++
.../s390/multiarch/dl-symbol-redir-ifunc.h | 4 +
.../sparcv9/multiarch/dl-symbol-redir-ifunc.h | 3 +
.../sparc64/multiarch/dl-symbol-redir-ifunc.h | 3 +
sysdeps/unix/sysv/linux/Makefile | 5 ++
sysdeps/unix/sysv/linux/dl-mmap.h | 34 +++++++++
sysdeps/unix/sysv/linux/dl-writev.h | 13 ++--
sysdeps/unix/sysv/linux/i386/dl-mmap.h | 38 ++++++++++
.../unix/sysv/linux/i386/pthread_kill_self.c | 26 +++++++
.../x86_64/multiarch/dl-symbol-redir-ifunc.h | 33 +++++++++
42 files changed, 520 insertions(+), 73 deletions(-)
create mode 100644 elf/tst-assert-startup-static.c
create mode 100644 elf/tst-pie-rpath-mod.c
create mode 100644 elf/tst-pie-rpath-static.c
create mode 100644 nptl/pthread_kill_self.c
rename sysdeps/{unix/sysv/linux/libc_fatal.c => generic/dl-mmap.h} (57%)
rename {elf => sysdeps/generic}/dl-writev.h (80%)
create mode 100644 sysdeps/generic/math-use-builtins-bitops.h
create mode 100644 sysdeps/powerpc/powerpc64/be/multiarch/dl-symbol-redir-ifunc.h
create mode 100644 sysdeps/s390/fpu/math-use-builtins-bitops.h
create mode 100644 sysdeps/unix/sysv/linux/dl-mmap.h
create mode 100644 sysdeps/unix/sysv/linux/i386/dl-mmap.h
create mode 100644 sysdeps/unix/sysv/linux/i386/pthread_kill_self.c
--
2.43.0
More information about the Libc-alpha
mailing list