From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Cc: Florian Weimer <fweimer@redhat.com>
Subject: [PATCH v10 5/5] elf: Remove __chk_fail from dl-minimal.c
Date: Tue, 23 Jun 2026 09:47:46 -0300 [thread overview]
Message-ID: <20260623124831.2165041-6-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20260623124831.2165041-1-adhemerval.zanella@linaro.org>
The elf/rtld-Rules adds $(no-fortify-source) on rtld object, so
__chk_fail is never used.
---
elf/Makefile | 1 +
elf/dl-minimal.c | 8 --------
include/sys/cdefs.h | 1 -
3 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/elf/Makefile b/elf/Makefile
index 9b0f10c7cc5..7ae62d0bf12 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1578,6 +1578,7 @@ endif
# These symbols might be emitted by the compiler when fortify is enabled
# (through builtins).
rtld-stubbed-symbols += \
+ __GI___chk_fail \
__GI___vfprintf_chk \
__GI___vsprintf_chk \
__GI___vsyslog_chk \
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 591d49e3f52..4583c48db3f 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -163,14 +163,6 @@ __libc_fatal (const char *message)
}
rtld_hidden_def (__libc_fatal)
-void
-__attribute__ ((noreturn))
-__chk_fail (void)
-{
- _exit (127);
-}
-rtld_hidden_def (__chk_fail)
-
#ifndef NDEBUG
/* Define (weakly) our own assert failure function which doesn't use stdio.
If we are linked into the user program (-ldl), the normal __assert_fail
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index a676f75f625..33d0a47f431 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -18,7 +18,6 @@
extern void __chk_fail (void) __attribute__ ((__noreturn__));
libc_hidden_proto (__chk_fail)
-rtld_hidden_proto (__chk_fail)
/* If we are using redirects internally to support long double,
we need to tweak some macros to ensure the PLT bypass tricks
--
2.43.0
next prev parent reply other threads:[~2026-06-23 12:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 12:47 [PATCH v10 0/5] elf: Allow RPATH/RUNPATH for static-pie Adhemerval Zanella
2026-06-23 12:47 ` [PATCH v10 1/5] nptl: Add __raise_direct Adhemerval Zanella
2026-07-09 10:01 ` Florian Weimer
2026-07-09 12:46 ` Adhemerval Zanella Netto
2026-06-23 12:47 ` [PATCH v10 2/5] Use _dl_writev on __libc_message_impl Adhemerval Zanella
2026-06-23 12:47 ` [PATCH v10 3/5] Fix assert during static startup (BZ 33326) Adhemerval Zanella
2026-07-09 13:00 ` Florian Weimer
2026-06-23 12:47 ` [PATCH v10 4/5] elf: Allow RPATH/RUNPATH for static-pie " Adhemerval Zanella
2026-06-23 12:47 ` Adhemerval Zanella [this message]
2026-07-09 10:03 ` [PATCH v10 5/5] elf: Remove __chk_fail from dl-minimal.c Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260623124831.2165041-6-adhemerval.zanella@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).