From patchwork Thu Oct 31 13:23:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 2004668 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 4XfPwc6g53z1xwF for ; Fri, 1 Nov 2024 00:29:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C133385703F for ; Thu, 31 Oct 2024 13:29:19 +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 6D5E73857357; Thu, 31 Oct 2024 13:25:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D5E73857357 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 6D5E73857357 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=1730381140; cv=none; b=W8N6zb6SiSOQfg9ekHnnv8NCGug1HzCiHheT43ykAb3HKwwqI5tJjD4tOdBgHDkaol38KYQjUMz9b1pjdL/8f8Lbh8NzD12vK+wjqxPkmgjI7wC7HXIzrJ927qFSIeCehEX7B8qMFwt5xaFmtWosxqU3iDFOxqoDYS5Ae7VnN38= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730381140; c=relaxed/simple; bh=RlO+1XvM88TsdQicF1LcFK333nekgY2xhCoSecX2pQM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=wg/5Re/rVbvUuVTt9OfoSHF7qp4+hxHI1FUSqFqtO8VTD41L7m9MR3bZy4lBYY8JVk4nbT95XFB+eoH/Jw0CC21Tt/YLUP4BG3oK7akGFs2nfnFqv+np9GrZelhug/vYHr5XfEBbLo+jN+VHn7j1cJlbpfV2dNxmkmtcwotusys= 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 024F81063; Thu, 31 Oct 2024 06:26:07 -0700 (PDT) Received: from udebian.localdomain (unknown [10.1.31.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 506383F528; Thu, 31 Oct 2024 06:25:36 -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 15/21] aarch64: Emit GNU property NOTE for GCS Date: Thu, 31 Oct 2024 13:23:17 +0000 Message-Id: <20241031132323.948159-16-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 gcc/ChangeLog: * config/aarch64/aarch64.cc (GNU_PROPERTY_AARCH64_FEATURE_1_GCS): Define. (aarch64_file_end_indicate_exec_stack): Set GCS property bit. --- gcc/config/aarch64/aarch64.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index f87ec2e43b5..88c7482efe0 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -29370,6 +29370,7 @@ aarch64_can_tag_addresses () #define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0) #define GNU_PROPERTY_AARCH64_FEATURE_1_PAC (1U << 1) +#define GNU_PROPERTY_AARCH64_FEATURE_1_GCS (1U << 2) void aarch64_file_end_indicate_exec_stack () { @@ -29382,6 +29383,9 @@ aarch64_file_end_indicate_exec_stack () if (aarch_ra_sign_scope != AARCH_FUNCTION_NONE) feature_1_and |= GNU_PROPERTY_AARCH64_FEATURE_1_PAC; + if (aarch64_gcs_enabled ()) + feature_1_and |= GNU_PROPERTY_AARCH64_FEATURE_1_GCS; + if (feature_1_and) { /* Generate .note.gnu.property section. */ @@ -29413,6 +29417,7 @@ aarch64_file_end_indicate_exec_stack () assemble_align (POINTER_SIZE); } } +#undef GNU_PROPERTY_AARCH64_FEATURE_1_GCS #undef GNU_PROPERTY_AARCH64_FEATURE_1_PAC #undef GNU_PROPERTY_AARCH64_FEATURE_1_BTI #undef GNU_PROPERTY_AARCH64_FEATURE_1_AND