| Message ID | 20260623124831.2165041-1-adhemerval.zanella@linaro.org (mailing list archive) |
|---|---|
| Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7E3154BA2E1E for <patchwork@sourceware.org>; Tue, 23 Jun 2026 12:49:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E3154BA2E1E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=sgm9QyfR X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-dy1-x1329.google.com (mail-dy1-x1329.google.com [IPv6:2607:f8b0:4864:20::1329]) by sourceware.org (Postfix) with ESMTPS id 1B5084BA2E30 for <libc-alpha@sourceware.org>; Tue, 23 Jun 2026 12:48:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B5084BA2E30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1B5084BA2E30 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782218916; cv=none; b=k+I7kAqmM4/rBS2YL7iBc/ZQWPOBUsXhOf1EBGjIgYHkW5gAhD/Q2q3Xd65TeQX14Y52k1qh0P20xv0OuDE4ZTIQOQDwuS39yIFsgjnPwIiMlKy6FVbXfBhoKLpvsvSRhi4RApgzOQoXsk00iQLT5afPGovEuzxjA76R04DTtSc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782218916; c=relaxed/simple; bh=yx2+F9JQnZQhykzX3BY1G2wGBDavk9vA8q909Nrxi8E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=biC7WIlCqieE7beIL+mxbTvAbwVrLc5iJcw6YuixwAWYyh06/vZKZB9WCJlT6vDBW04j7jXBVzT2MaJ2Lvb5MgvmcGNbK3Rbf2vuYBTWXoIvCSSEewDYbXiECxu0UxtgSTvARm3RkiDRCzzAPdQ7nDw9rJ86Sln8lo7jjT1TYhQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=sgm9QyfR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B5084BA2E30 Received: by mail-dy1-x1329.google.com with SMTP id 5a478bee46e88-30bbe98c3f0so10771376eec.0 for <libc-alpha@sourceware.org>; Tue, 23 Jun 2026 05:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782218915; x=1782823715; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZMz7KPIm8MH+DSPfy1DKPBMjKlWy8YvDQF0l/VgDUPM=; b=sgm9QyfRrvwqRWUW/GgxQMhJTZYNXmyUq0SmXgLT9z7NBFgcvQ4rWNQ5J0YGO51GgD Mm2srCahhtQvG40mySmcj5QEB/Cnn41ba3A3ROJA2Vz/rgLS5s2OAvxSyBYZp/ys4ESZ jwvqRDkLE9G2s+l8/p1wvZaxaeUSUtN4Wxr9VeAtxCx2Ps+yyGx5Nkwz7SVkj944erto Uz3IJAmO7I7oAwgIfep8MME9LDSB1Fx7hK5SNPw0ngNCkgskvoZKhCR9lS+WgNxl4xxq 7d955QceJAfLGYpGI4OYMPf0YgD/Mua1SMURr6MLyvyCw8yvRn9vrBdimjVqwX7FHW4+ dxsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782218915; x=1782823715; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZMz7KPIm8MH+DSPfy1DKPBMjKlWy8YvDQF0l/VgDUPM=; b=kiGHjNvMxRoFtO+2fNPHvG/wbgwa97KEwdz29jF2+P3iVFCyuNKzy4Ba0eNM09uWVG I7T5RP8ToWV56Pm47C4wJJRm2xPyQJoVq3iakfnwK88w4UIwnTAXrUPQBIgM0DV6GRxM ZCJYCTFfrflRrTa2XJgJDaCNc2sUkpznJSAw6bk3UfkfBv9UysnHqXjrjNITRWx2TkB5 /UfrLDtVpLNKmJvtBpkTwPp1sT6XMB6DIIou2pvA+s4Z7osUxW/BgUSRqVNsTbAtBnDt em+Vhwwo6+dVMEBMiLQxQHrameZpSEmAl/IBV7ayv+PrlmAByOxNLJo1td2IIK3bzYW6 Z3Lw== X-Gm-Message-State: AOJu0Yzq6JiKAoL9lMCNOUgVVfZlUfNPGNQQ0CafUdmoaxhtlaDEMi3R r61VoGp35hAg7PCMVVCCmi3PLxjF+Z8oITocR+dmG8/UraDdbEtd8aaTLghSmS+pzxyMxOImmOJ X0/IT X-Gm-Gg: AfdE7ckpWkGY/npzY16eqFGa0xShhR8UoSCvRfMAFDKYj+44MX+8dJ2grBbutOUe7P4 3/0r52ltp6q6s0Wr7n0PgqJKgwVk+nB7e4nxB1NPiK0HPbeVBfEbZNMbF95oUqf5zPNtS+hEgvB x5Wk5R05/HHF7b6Z6Yla5lcnVRRWR/XnwMrRJs++4fGRcMDa5m3O8HCWIwJgILL1avht8erfsHW ja4fqAMhD+vnBDARX132XmP21se7+Ujp056B2uA/Vpw+Yzs0HVtFH9CPiI68btHQgeM5C62KMh7 jkePp5y4iqXHBHAxA2B0zFXQKLM1ZCQ+OKS3rtd9vLGf3e5/19nDr6nrc+tBk2dizzUCumePZ8P D+HoPW5XkMdM4cAECfvV6kAJUGqDZ3RLnnh8qTpl0/RdlAgxmpWDcRV1o/2oCMFy1acpG35ZJzI mT5z770OwaSzJzdAMCeeq2qc3K X-Received: by 2002:a05:7301:5f09:b0:304:e72a:d4d9 with SMTP id 5a478bee46e88-30c58b66e50mr2628937eec.19.1782218914872; Tue, 23 Jun 2026 05:48:34 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:d170:82d3:e54e:278a:ac84]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-139adca1b18sm12183777c88.3.2026.06.23.05.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2026 05:48:34 -0700 (PDT) From: Adhemerval Zanella <adhemerval.zanella@linaro.org> To: libc-alpha@sourceware.org Cc: Florian Weimer <fweimer@redhat.com> Subject: [PATCH v10 0/5] elf: Allow RPATH/RUNPATH for static-pie Date: Tue, 23 Jun 2026 09:47:41 -0300 Message-ID: <20260623124831.2165041-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
| Series | elf: Allow RPATH/RUNPATH for static-pie | |
Message
Adhemerval Zanella Netto
June 23, 2026, 12:47 p.m. UTC
iAlthough 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.
Changes from v9:
* Rebased against master.
* Added review from previous version.
Changes from v8:
* Rebased against master.
* Added review from previous version.
Changes from v7:
* Also raise SIGABRT on assert for ld.so. The hurd __raise_direct
is no-op that requires a proper implementation (so current semantic
is kept).
Changes from v6:
* Improve comments.
* Remove unused files.
Changes from v5:
* Move _dl_writev and _dl_mmap to their own TU for i386 to avoid
I386_USE_SYSENTER redefinition.
* Fixed generic __raise_direct and add a TODO for Hurd.
Changes from 4:
* Rename __raise_nocancel to __raise_direct and remove default
implementation.
* Simplify _dl_writev.
Changes from v3:
* Added Wilco's suggestion on fallback implementation for ctz/clz.
* Rebased against master.
* Fixed another riscv issues.
Changes from v2:
* Fixed a build for x86_64-linux-gnu-v3.
* Adjust the elf/tst-pie-rpath-static to run correctly when
--enable-hardcoded-path-in-tests is not used
Changes from v1:
* Change the ctz/clz fallback to simpler algorithms and use a different
header/macro with a better explanation of its intend.
* Rename __pthread_kill_self to __raise_nostatus.
* Fixed assert also for powerpc-power4 and riscv.
Adhemerval Zanella (5):
nptl: Add __raise_direct
Use _dl_writev on __libc_message_impl
Fix assert during static startup (BZ 33326)
elf: Allow RPATH/RUNPATH for static-pie (BZ 33326)
elf: Remove __chk_fail from dl-minimal.c
assert/Makefile | 5 ++
elf/Makefile | 30 +++++++++++
elf/dl-load.c | 2 +-
elf/dl-minimal.c | 8 ---
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 | 40 ++++++++++++++
elf/tst-pie-rpath-mod.c | 19 +++++++
elf/tst-pie-rpath-static.c | 52 +++++++++++++++++++
include/signal.h | 3 ++
include/sys/cdefs.h | 1 -
libio/Makefile | 5 ++
nptl/pthread_kill.c | 21 +++-----
stdlib/Makefile | 5 ++
string/Makefile | 1 +
.../aarch64/multiarch/dl-symbol-redir-ifunc.h | 1 +
sysdeps/aarch64/multiarch/memcpy_generic.S | 4 ++
sysdeps/generic/dl-mmap.h | 34 ++++++++++++
{elf => sysdeps/generic}/dl-writev.h | 18 +++----
.../lp64/multiarch/dl-symbol-redir-ifunc.h | 1 +
sysdeps/posix/libc_fatal.c | 27 ++++++----
sysdeps/posix/raise.c | 2 +-
.../powerpc32/power4/multiarch/Makefile | 5 ++
.../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 ++
.../s390/multiarch/dl-symbol-redir-ifunc.h | 4 ++
sysdeps/s390/string-bitops.h | 27 ++++++++++
.../sparcv9/multiarch/dl-symbol-redir-ifunc.h | 3 ++
.../sparc64/multiarch/dl-symbol-redir-ifunc.h | 3 ++
sysdeps/unix/sysv/linux/Makefile | 16 ++++++
sysdeps/unix/sysv/linux/dl-writev.h | 12 ++---
sysdeps/unix/sysv/linux/i386/Makefile | 14 +++++
sysdeps/unix/sysv/linux/i386/dl-mmap.c | 35 +++++++++++++
sysdeps/unix/sysv/linux/i386/dl-mmap.h | 27 ++++++++++
.../linux/{libc_fatal.c => i386/dl-writev.c} | 28 +++++-----
sysdeps/unix/sysv/linux/i386/dl-writev.h | 15 ++++--
sysdeps/unix/sysv/linux/i386/raise_direct.c | 26 ++++++++++
sysdeps/unix/sysv/linux/raise_direct.c | 29 +++++++++++
.../unix/sysv/linux/riscv/multiarch/Makefile | 12 +++--
.../x86_64/multiarch/dl-symbol-redir-ifunc.h | 21 ++++++++
44 files changed, 519 insertions(+), 84 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 sysdeps/generic/dl-mmap.h
rename {elf => sysdeps/generic}/dl-writev.h (80%)
create mode 100644 sysdeps/powerpc/powerpc64/be/multiarch/dl-symbol-redir-ifunc.h
create mode 100644 sysdeps/s390/string-bitops.h
create mode 100644 sysdeps/unix/sysv/linux/i386/dl-mmap.c
create mode 100644 sysdeps/unix/sysv/linux/i386/dl-mmap.h
rename sysdeps/unix/sysv/linux/{libc_fatal.c => i386/dl-writev.c} (58%)
create mode 100644 sysdeps/unix/sysv/linux/i386/raise_direct.c
create mode 100644 sysdeps/unix/sysv/linux/raise_direct.c