From patchwork Sun Apr 15 11:06:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 898241 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476403-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=intel.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OCgq4m6b"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40P7xq4zyPz9s0x for ; Sun, 15 Apr 2018 21:06:53 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=mmnA2UDINm/k6y8+JsZPRps8yEma+f7jEoQrUwgHs2i +DkhRJXvIyVuXZSWgovD7ifT+R6LzDHsDGsoX+TECsLOVE0NobY6HOzjU0xGmbU2 pO5FepwolWpXd9B7jNQsJypreEynKbS+3qkpJTbsP762THJsMFLMBvD3Zc0ip8CA = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=O/ELEH4GvyqZsnUXl4E5xhXWfb4=; b=OCgq4m6bIaCcNi1ID bDBfa6mtcptQCbLiJjZZNV+F828Osr7TGlsoq6r6KSQ6Ia/A2gWQdPXrpgQjJETI MNF/rPBrmuAFR8ERX1ZojcHYYqrat/LehvWsRKe5+LQDydUw8vitGCmX8jvJHS0+ VWBlVhTK6TvaPkKoPILOp/RA2o= Received: (qmail 47436 invoked by alias); 15 Apr 2018 11:06:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 47397 invoked by uid 89); 15 Apr 2018 11:06:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM autolearn=ham version=3.3.2 spammy=assemble X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Apr 2018 11:06:44 +0000 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Apr 2018 04:06:17 -0700 X-ExtLoop1: 1 Received: from gnu-cfl-1.sc.intel.com ([172.25.70.237]) by orsmga004.jf.intel.com with ESMTP; 15 Apr 2018 04:06:17 -0700 Received: by gnu-cfl-1.sc.intel.com (Postfix, from userid 1000) id 200A3440ADC; Sun, 15 Apr 2018 04:06:17 -0700 (PDT) Date: Sun, 15 Apr 2018 04:06:17 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org, Uros Bizjak , Igor Tsimbalist Subject: [PATCH] x86/cet: Properly output labels in property note section Message-ID: <20180415110617.GA27586@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Replace ASM_OUTPUT_LABEL with fprintf so that internal labels in property note section are unchanged -fleading-underscore. OK for trunk? H.J. --- gcc/ PR target/85404 * config/i386/cet.c (file_end_indicate_exec_stack_and_cet): Replace ASM_OUTPUT_LABEL with fprintf. gcc/testsuite/ PR target/85404 * gcc.target/i386/pr85404.c: New test. --- gcc/config/i386/cet.c | 10 +++++----- gcc/testsuite/gcc.target/i386/pr85404.c | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr85404.c diff --git a/gcc/config/i386/cet.c b/gcc/config/i386/cet.c index 4a1e013fdde..d5bbe8b7fe8 100644 --- a/gcc/config/i386/cet.c +++ b/gcc/config/i386/cet.c @@ -57,20 +57,20 @@ file_end_indicate_exec_stack_and_cet (void) fprintf (asm_out_file, ASM_LONG " 4f - 1f\n"); /* note type: NT_GNU_PROPERTY_TYPE_0. */ fprintf (asm_out_file, ASM_LONG " 5\n"); - ASM_OUTPUT_LABEL (asm_out_file, "0"); + fprintf (asm_out_file, "0:\n"); /* vendor name: "GNU". */ fprintf (asm_out_file, STRING_ASM_OP " \"GNU\"\n"); - ASM_OUTPUT_LABEL (asm_out_file, "1"); + fprintf (asm_out_file, "1:\n"); ASM_OUTPUT_ALIGN (asm_out_file, p2align); /* pr_type: GNU_PROPERTY_X86_FEATURE_1_AND. */ fprintf (asm_out_file, ASM_LONG " 0xc0000002\n"); /* pr_datasz. */\ fprintf (asm_out_file, ASM_LONG " 3f - 2f\n"); - ASM_OUTPUT_LABEL (asm_out_file, "2"); + fprintf (asm_out_file, "2:\n"); /* GNU_PROPERTY_X86_FEATURE_1_XXX. */ fprintf (asm_out_file, ASM_LONG " 0x%x\n", feature_1); - ASM_OUTPUT_LABEL (asm_out_file, "3"); + fprintf (asm_out_file, "3:\n"); ASM_OUTPUT_ALIGN (asm_out_file, p2align); - ASM_OUTPUT_LABEL (asm_out_file, "4"); + fprintf (asm_out_file, "4:\n"); } } diff --git a/gcc/testsuite/gcc.target/i386/pr85404.c b/gcc/testsuite/gcc.target/i386/pr85404.c new file mode 100644 index 00000000000..bbf456ec024 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85404.c @@ -0,0 +1,6 @@ +/* { dg-do assemble } */ +/* { dg-options "-fleading-underscore -mcet -fcf-protection" } */ + +void func(void) __asm("_func"); +void _func(int x) {} +void func(void) {}