From patchwork Tue Jun 23 12:47:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 137637 Return-Path: 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 084764BA2E3B for ; Tue, 23 Jun 2026 12:50:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 084764BA2E3B 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=Lbp7uIag X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-dl1-x1234.google.com (mail-dl1-x1234.google.com [IPv6:2607:f8b0:4864:20::1234]) by sourceware.org (Postfix) with ESMTPS id 776A54BA23D5 for ; Tue, 23 Jun 2026 12:48:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 776A54BA23D5 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 776A54BA23D5 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1234 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782218925; cv=none; b=AmspsjkiM6V+XL1VnqMx1uv94rFanloMzU9Xcv2qijy03xCdpBUcrN1STnvz7sKZKEXTJqTDQAECpTuajpoQRO4OGkyguToqjkYJCiBv2GcG4eiRTfYMOcSNomHUry5zkSGljkFNwFYJgBuFUDcyurAYaslwixY4utf2sNnpvt0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782218925; c=relaxed/simple; bh=cYNyQaLQDgyNCYNOWqe1SvAGk62cuDOfbRZNv6XktkY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=R4FmjSnjrSPGb0nFBjt4eyFvWRJA8R1DEVWEwQaQdl1j+TgtjlzBgNG55CAHwkayuq/upL2OP0lnU7RiS+Zab2XOx6yIAQ+VD3ErIp6AHo5yu6PPfTsYrnzY+3TIuC4E/4qI69wAJCmvTm5AsgisQ+mre9t2tG7Wza4bEO4cLmc= 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=Lbp7uIag DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 776A54BA23D5 Received: by mail-dl1-x1234.google.com with SMTP id a92af1059eb24-13981833e13so6108533c88.1 for ; Tue, 23 Jun 2026 05:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1782218924; x=1782823724; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HRpQPsTVY+nmfE6Z3800kB/VRagvxYdtOHISq+S5b5U=; b=Lbp7uIag3ZyUer6+2IrPpq7DBwXzf+fCdJtDcU9mfd543vyx87axScWKI2bZVkiVp/ gMdL9hgGLPMksyeGJa9Bg2fBu8znsqSOhd5W9wnNcEA/QTgCC8qT+BQ2JRAidOnD7DyU A06iaWL83db2ww6SfYK5L1Q5X5nwoMV2zkwGWaQevhae7NQFsyLTuOmF3mshaUg4hd+1 zSGjFIyK+Z9SJ8wJiKUiwGFIu/8LKbGw11L6dOmD0/jtODL84iE1xNC+QYpoTiZII9ms oD/V8C/OjHYggVjKtfFrOruiYn4GSXCIfiaW7si9iFUKZCDNw57/0gRDAvdCyedxOlDq nSMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782218924; x=1782823724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HRpQPsTVY+nmfE6Z3800kB/VRagvxYdtOHISq+S5b5U=; b=SteZoa5e//4brQwL8OGJnAVkY2OtaEwRZV93KCVVHxguJw8F+vawNdJNkGOVRpGgDz A5iZ6rNDerEP/9TVunXyBN+0KvwJH+IMZl2rYWLxdHxSNF5jCzhkUCTZzd2B5wV90F5y BCyHwF7ZZh494LvAxOeE0cDR5CACkLku88BjV0koHWucbT/yn9vdNW9F78FwC8MNhXK9 ujqbN5pEh1BXMqdj0NJDD7VCj0ojbf8XXYkZw7iuP8DSKREtHauI/dI7rm9pMshUkQ3+ BJmI7ekUgQM3jcnnxxz5tbqGVnf6V1ZjhCmFDqleIrKrQVT3ThMeyjEktjf3hpHKaprG H6/A== X-Gm-Message-State: AOJu0YxupEn+rUcMVHBje5tOU2LodHzxrCCsY87peJH7qc3E994keKO7 IouhurWC0NESO85hKahCxRr8tgqTO2VoHccWh8tRBy8m6keXdvnc+XB+/3Z9+y+c2C/EKAyuZ4C b2j/u X-Gm-Gg: AfdE7cnorO6nZtSvUw0h0o587jijyrjleFRUobrTP0ESPEFxrROQLJqlhEH4vnQx7Sj 7ztQxR5mBaussG/SHp3aCiICOfY0Ih+hX/YkifdR/NL+a9JfsgUUlaWfiAD1kkWakCPZmXlzCxR l5gFkemCwR1EITS1XVd+yvO0dXlvLq4+NKD1PqDSOPaRo/s9//PpKC3UKoHz003rtLvVrsRno9n Y5g1XyV+UH3Z8321hEhyBpdXZgA/9h4IMXEThuh72eVJrlGLYWNpr6Qch6o/uZQUe8Np6y3xXUz XaIdYcXIrBLUVn2bh+DTLylfwpc8EdKuRrZoV7cqP69NAmn+Pe9azB+2Qp/ECF38auAd0VAXvTw 02VScpSfBWgo0LtCi4bEqz/pc/fuS8stnsLaMQbsD+JpDGPJIUa5SmeyCmR5ae4BfEx7W7yiOXT b2DW1aBcvJ0mI0pXFD+6VwZqN5 X-Received: by 2002:a05:7022:203:b0:134:dfd0:9760 with SMTP id a92af1059eb24-139c5cd8ad5mr1971064c88.5.1782218924181; Tue, 23 Jun 2026 05:48:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2026 05:48:43 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Florian Weimer Subject: [PATCH v10 5/5] elf: Remove __chk_fail from dl-minimal.c Date: Tue, 23 Jun 2026 09:47:46 -0300 Message-ID: <20260623124831.2165041-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260623124831.2165041-1-adhemerval.zanella@linaro.org> References: <20260623124831.2165041-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org The elf/rtld-Rules adds $(no-fortify-source) on rtld object, so __chk_fail is never used. Reviewed-by: Florian Weimer --- 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