From patchwork Mon May 9 14:51:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1628670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=W0YzvdbS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KxkfT1sxRz9sGJ for ; Tue, 10 May 2022 00:52:15 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16260394B000 for ; Mon, 9 May 2022 14:52:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16260394B000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652107933; bh=sDVajWRuHB1ONpUUkCezYyy4hIcWDORobnWF33Rzy3s=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=W0YzvdbSmJFX3tEEkhTwGLLMd8VWqCwmyGwAVU/m7Nekm8G5w/figUWwVLVwoCHOa o7PoEzg07OQlNc3FCBGfeNPzbYuDfiH9PI87XIanjoFSVycEeHqwxCFBpfDY8uKgkH bcB5jSdjlvI1b8AQRIW036wsJal9yWNdjlDLtsrs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 71ADC3948825 for ; Mon, 9 May 2022 14:51:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71ADC3948825 Received: by mail-pj1-x1029.google.com with SMTP id j10-20020a17090a94ca00b001dd2131159aso2057295pjw.0 for ; Mon, 09 May 2022 07:51:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=sDVajWRuHB1ONpUUkCezYyy4hIcWDORobnWF33Rzy3s=; b=wwrLOdCf3XfHrOFi1RGXe4wseVTdRgxxrVhODUuETG1ODEyyNPLSgqWNrrPnUMqsgp 6dhH8ZbjlkiA8cj1B0lwnte+H94Sns88EA+0lJA2okFkPW76MMVvr+rPZQ6I9OT95ANN 3Zaek50vJu9n8/t7RvOuVsppoqAvC0g8Le2BKhE+72JDfM3cX7IawmiuG2b+rRB0PdCm Hv0o1UyIaETNZtaNR0m6n29+4cr/9xGCI5JdJJju9szHeM6VdP/0mAnuIeszgQcC8IYB WUOLJxLEm3ByWl76j5DVG0cIO0Wan0lK6YXFu4JjP7Nl4KoeUEm/5OgmhooTHWdY6iuc 9pmw== X-Gm-Message-State: AOAM530I2JFPGbMY2N7pN2lPeVg7H3gREyVFPCYhUrmC5xX8pyPyfx0W 7U+k5d/EkXEmSDgTaL0P61YbaZ90zx8= X-Google-Smtp-Source: ABdhPJwKB95/OTgS+MSPtSEMwiC7BQAetGwYeok8/r5hP9LDLofTWZ0Ll357vyjgXjbwykr05vc0LQ== X-Received: by 2002:a17:903:14a:b0:15c:f657:62cd with SMTP id r10-20020a170903014a00b0015cf65762cdmr16580189plc.36.1652107912027; Mon, 09 May 2022 07:51:52 -0700 (PDT) Received: from gnu-tgl-3.localdomain ([172.58.88.122]) by smtp.gmail.com with ESMTPSA id g4-20020a170902c38400b0015e8d4eb20bsm7185633plg.85.2022.05.09.07.51.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 07:51:51 -0700 (PDT) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 46121C03EC for ; Mon, 9 May 2022 07:51:50 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] x86: Add .note.GNU-stack section only for Linux Date: Mon, 9 May 2022 07:51:50 -0700 Message-Id: <20220509145150.726519-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3028.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Add .note.GNU-stack section only for Linux since it may not be supported on non-Linux OSes. __ELF__ isn't checked since these tests can only run on Linux/x86 ELF systems. PR target/105472 * gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section only for Linux. * gcc.target/x86_64/abi/asm-support.S: Likewise. * gcc.target/x86_64/abi/avx/asm-support.S: Likewise. * gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise. * gcc.target/x86_64/abi/avx512fp16/asm-support.S: Likewise. * gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S: Likewise. * gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S: Likewise. * gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise. --- gcc/testsuite/gcc.target/i386/iamcu/asm-support.S | 2 ++ gcc/testsuite/gcc.target/x86_64/abi/asm-support.S | 2 ++ gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S | 2 ++ gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support.S | 2 ++ gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/asm-support.S | 2 ++ .../gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S | 2 ++ .../gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S | 2 ++ gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S | 2 ++ 8 files changed, 16 insertions(+) diff --git a/gcc/testsuite/gcc.target/i386/iamcu/asm-support.S b/gcc/testsuite/gcc.target/i386/iamcu/asm-support.S index db08f52a34f..9d6be88e7d5 100644 --- a/gcc/testsuite/gcc.target/i386/iamcu/asm-support.S +++ b/gcc/testsuite/gcc.target/i386/iamcu/asm-support.S @@ -300,4 +300,6 @@ iamcu_noprintf: .align 4 .LCiamcu_noprintf1: .long 1132527616 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S index 2f8d3a09c6b..b2ad67aef87 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S @@ -82,4 +82,6 @@ snapshot_ret: .comm xmm_regs,256,32 .comm x87_regs,128,32 .comm volatile_var,8,8 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S index 77b3480ac32..24c8b3c9023 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S @@ -79,4 +79,6 @@ snapshot_ret: .comm ymm_regs,512,32 .comm x87_regs,128,32 .comm volatile_var,8,8 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support.S index 2e3306c44cb..86d54d11c58 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support.S @@ -95,4 +95,6 @@ snapshot_ret: .comm zmm_regs,2048,64 .comm x87_regs,128,32 .comm volatile_var,8,8 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/asm-support.S index 0793acf048b..a8165d86317 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/asm-support.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/asm-support.S @@ -79,4 +79,6 @@ snapshot_ret: .comm xmm_regs,256,32 .comm x87_regs,128,32 .comm volatile_var,8,8 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S index 77b3480ac32..24c8b3c9023 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S @@ -79,4 +79,6 @@ snapshot_ret: .comm ymm_regs,512,32 .comm x87_regs,128,32 .comm volatile_var,8,8 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S b/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S index 2e3306c44cb..86d54d11c58 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S @@ -95,4 +95,6 @@ snapshot_ret: .comm zmm_regs,2048,64 .comm x87_regs,128,32 .comm volatile_var,8,8 +#ifdef __linux__ .section .note.GNU-stack,"",@progbits +#endif diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S index f5dff4c10ab..37338b23fec 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S @@ -30,7 +30,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifdef __ELF__ # define FN_TYPE(fn) .type fn,@function # define FN_SIZE(fn) .size fn,.-fn +# ifdef __linux__ .section .note.GNU-stack,"",@progbits +# endif #else # define FN_TYPE(fn) # define FN_SIZE(fn)