From patchwork Mon Jul 29 07:36:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1965876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=fl5TNUxE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WXVY96RC7z20FY for ; Mon, 29 Jul 2024 17:36:45 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2CF3D385840E for ; Mon, 29 Jul 2024 07:36:44 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id ACF44385840D for ; Mon, 29 Jul 2024 07:36:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACF44385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ACF44385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::729 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722238588; cv=none; b=guTE49oubfb6pF3tG04T8RiPvI6FmEsQCOwonGTkQiTJjLcIOx8ixpZ6BABKdFjkubXpDsS4ddQe7XwKnKASskHIjnWMzZ7iul0CGalRaQADHQ+joPuCzXT4q1bZcuvkRINS4KqDG5RTUaBhFlxIp4hX2Gnlhwr1ojeDVkz8YU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722238588; c=relaxed/simple; bh=61KkTGx4UdLscxjhDWMbkUFaciE6lkl0wGBmtMfDs2E=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=cLMl2V/APF2osV5yFI3rq26xrGepyjIcUHto9Zz6oVhJYvxJFp143vCppkpZHv0TjapXZxWevWLS9KLwDII6mnCzxN4cRETbiHc4bwOALZnqY6dcKcbk0ccQ2A5KVyZiCEEj8QnMiljlg1l1FRjTv580lU9DkxofZodoiONE0RA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-7a1e2ac1ee5so184549985a.2 for ; Mon, 29 Jul 2024 00:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722238585; x=1722843385; 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=DkGLtGT4I48ULchztSdy58vqHV6L5tMHb8hZacD3JQA=; b=fl5TNUxE6XB7K7R0zla6TQya0Yn3m9yygXa7AoGfeFwBOJd5OJMoSYZ26IqaeAn+R4 5CL7u0rSL3CeH70kJAA/ZsRNp9o5H8u2R+hXVioNHWAHsJY0mqCIJLbjSO6gtpwrGHeZ C3fClAuUirH4pPlKsXYNGHB5hT+kmfAbFd9eqA+vSC1PxDQnNSDJ2RFdOGcRLPUJ4iIH ylL1AX5vKuW9cERYHaLQKANJpWP4f9qDnZ4iyuZDn6iDclOyQ37RkAKm+dMXBa7O2pdd tlA5kscMikc+cTOi3Dht7z6cqZcc4/6pC5pkGKbPBTM7Cs++dD0PNnnabOFCp4Ulywnr HVpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722238585; x=1722843385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DkGLtGT4I48ULchztSdy58vqHV6L5tMHb8hZacD3JQA=; b=q9VqBflYiNfsbIAa8cJkR6anmepgJ28RZz4FAhyuYct+MeAbUE3w3ZS/H4ABBugcBY BMHvafIFbtjnHTC2nk+555PDpgdfozS+8yRVB+mE8Dr/lFk3b/OkuQ370m4VwGYxyC0u eNIb6fhZT8papLFX/RBcFXnHwOoIlw/teg0cmmrxkR1rQtrhcTiZDlE5RKsYfh7rcK8D 4ZPyemG6phL2BlNoJLfBXTljCERzINfY3FN71b2FBCKrn1CXuvVLC2ab52sxCjIe2nud AsZJCkYIYr+QmODMx/PkzTbCfEVN2JI0X01vq1JkKjghKOVpblXWynG2srWGTSIg/OvJ xOkg== X-Gm-Message-State: AOJu0YwjbNSIz6S5TcCQcYoMbwhs0Q4X7edE14LC5jKjLZmVHT6KmbCh BrYG6XK7ZnSXDGMSznjaczXCYRw9HLfquC4IstCqoIBFF+TErLkcieAS6gRaoDA= X-Google-Smtp-Source: AGHT+IFNMG38Yn7SxPj1QkXlb8SMzmZx7jkGGjgmcnJqE4/T+UGNtk2fQxWEJCxFmblmyz2tfBKazw== X-Received: by 2002:a05:620a:269a:b0:79f:137a:e4f7 with SMTP id af79cd13be357-7a1e5223f63mr929283785a.12.1722238584655; Mon, 29 Jul 2024 00:36:24 -0700 (PDT) Received: from noahgold-desk.sh.intel.com ([192.55.46.42]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a1d73ed3bcsm494911485a.66.2024.07.29.00.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 00:36:24 -0700 (PDT) From: Noah Goldstein To: libc-alpha@sourceware.org Cc: goldstein.w.n@gmail.com, hjl.tools@gmail.com Subject: [PATCH v1] stdlib: Mark `abort` as `cold` Date: Mon, 29 Jul 2024 15:36:17 +0800 Message-Id: <20240729073617.1205552-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.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~incoming=patchwork.ozlabs.org@sourceware.org This helps HotColdSplitting in GCC/LLVM. Thought about doing `exit` as well since its only called once per process, but since its easy to imagine a hot path leading into `exit(0)`, its less clear if its profitable. Reviewed-by: Carlos O'Donell --- stdlib/stdlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 901926e893..17487c6640 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -727,7 +727,7 @@ extern void *aligned_alloc (size_t __alignment, size_t __size) #endif /* Abort execution and generate a core-dump. */ -extern void abort (void) __THROW __attribute__ ((__noreturn__)); +extern void abort (void) __THROW __attribute__ ((__noreturn__)) __COLD; /* Register a function to be called when `exit' is called. */