From patchwork Thu Oct 31 13:23:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 2004660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.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 4XfPsF4rynz1xwF for ; Fri, 1 Nov 2024 00:26:25 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79C453857350 for ; Thu, 31 Oct 2024 13:26:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id BA8243858CDB; Thu, 31 Oct 2024 13:25:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA8243858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BA8243858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730381150; cv=none; b=SxDT1W2/7Vm3MU9U/eoN9ZZ+3tgjlCNPiFrvwbaeyaC7VJjJUe/VHb9L5iTGduDWZ+8FERl79x2cQlubAZpw/JUCDFx0I1VRXUv8JvSAKkSrw3ZKiLy5TLQMqXdb7o7BESUCO8HC6vMCXD/qf3KQm+trH1xP8bFKbLX61tlEd7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730381150; c=relaxed/simple; bh=6SmsPnsLBaRuYUm/xz72s0PjLDVpUSvCZVMXTowHFVg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=nD9DpjDvZJ/S62/ijHYlCm327cVBq7BXRMpEev/IFMzm114zDHa19uMd4TG2uDo8ickT5XfvSUABJ4+IoyQRz0jIcLjEBHl3Pc4UmvOOsuamA5dFamdXkrdTZ8BRNHpu27SPnofb2uNfLbULpNqrstVnN88Yr0Vk6E9EpeY0EiY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4949C1063; Thu, 31 Oct 2024 06:26:13 -0700 (PDT) Received: from udebian.localdomain (unknown [10.1.31.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B65D23F528; Thu, 31 Oct 2024 06:25:42 -0700 (PDT) From: Yury Khrustalev To: gcc-patches@gcc.gnu.org Cc: nsz@gcc.gnu.org, richard.earnshaw@arm.com, matthieu.longo@arm.com, richard.ball@arm.com, richard.sandiford@arm.com Subject: [PATCH v2 16/21] aarch64: libgcc: add GCS marking to asm Date: Thu, 31 Oct 2024 13:23:18 +0000 Message-Id: <20241031132323.948159-17-yury.khrustalev@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241031132323.948159-1-yury.khrustalev@arm.com> References: <20241031132323.948159-1-yury.khrustalev@arm.com> MIME-Version: 1.0 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Szabolcs Nagy libgcc/ChangeLog: * config/aarch64/aarch64-asm.h (FEATURE_1_GCS): Define. (GCS_FLAG): Define if GCS is enabled. (GNU_PROPERTY): Add GCS_FLAG. --- libgcc/config/aarch64/aarch64-asm.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libgcc/config/aarch64/aarch64-asm.h b/libgcc/config/aarch64/aarch64-asm.h index d8ab91d52f1..f7bd225f7a4 100644 --- a/libgcc/config/aarch64/aarch64-asm.h +++ b/libgcc/config/aarch64/aarch64-asm.h @@ -22,6 +22,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#ifndef AARCH64_ASM_H +#define AARCH64_ASM_H + #include "auto-target.h" #define L(label) .L ## label @@ -38,6 +41,7 @@ #define FEATURE_1_AND 0xc0000000 #define FEATURE_1_BTI 1 #define FEATURE_1_PAC 2 +#define FEATURE_1_GCS 4 /* Supported features based on the code generation options. */ #if defined(__ARM_FEATURE_BTI_DEFAULT) @@ -58,6 +62,12 @@ # define AUTIASP #endif +#if __ARM_FEATURE_GCS_DEFAULT +# define GCS_FLAG FEATURE_1_GCS +#else +# define GCS_FLAG 0 +#endif + #ifdef __ELF__ #define HIDDEN(name) .hidden name #define SYMBOL_SIZE(name) .size name, .-name @@ -88,8 +98,8 @@ .previous /* Add GNU property note if built with branch protection. */ -# if (BTI_FLAG|PAC_FLAG) != 0 -GNU_PROPERTY (FEATURE_1_AND, BTI_FLAG|PAC_FLAG) +# if (BTI_FLAG|PAC_FLAG|GCS_FLAG) != 0 +GNU_PROPERTY (FEATURE_1_AND, BTI_FLAG|PAC_FLAG|GCS_FLAG) # endif #endif @@ -106,3 +116,5 @@ GNU_PROPERTY (FEATURE_1_AND, BTI_FLAG|PAC_FLAG) #define END(name) \ .cfi_endproc; \ SYMBOL_SIZE(name) + +#endif