From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id D217E3858D32 for ; Mon, 13 Mar 2023 20:45:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D217E3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102b.google.com with SMTP id k18-20020a17090a591200b0023d36e30cb5so122099pji.1 for ; Mon, 13 Mar 2023 13:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678740318; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=12FDAz9iZy6WUeaeM8qBD6FR+Awb1mzQQ8vLHtw5gr0=; b=ih4sJsTvbIESKdpmXaTTK+sbCwuCdnSwxcYlI+RjXG0Jd1T9pQuwF/1n5euMr0VyzS WLuyqEriPQMFAb7bm2pURBjjWHbeABUsmV2U3LPseqJdcqvlRTOfrnIZYmvd+WjLLnaP UUdgW+NmzwmGKCpszXJ3GjINI4E0v3Rv18FY36emNz/Rx62eIrSGjwUqfQHBfey9qO9X s9Q7EIfQQSdZmjscAkKpEg8O8lk0yW70Bj6x+KTzpoXCoYK5qOIrNItIDOw3FjuZLwzJ KkwBevNjzj7LcMbUwUfcPWrvbN3Z9rZwYz8StvJ1xrabrLG35wsg4J9MlQ7AbtIhBhr9 LuOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678740318; 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=12FDAz9iZy6WUeaeM8qBD6FR+Awb1mzQQ8vLHtw5gr0=; b=LlMYpkz4tNnSR+e9OgF5D3kkso4Bi2+DyFQ+1ZSvYz18ccHjPUVBR3K9RuT9Jgjy7k k7hatvkx+yDnSvQDipSgi3ZghdPAGD2fFcGEiOMQNiavOVcTP97uAzGR9qt/KW6xWpZk 0itLNC7PKrmXO/YZxoslKT3m9Tyc+L7Rj5ghSwGUvs1X9Nw2zK6ozLgn3+vGZp3ylGCL rKdw8R1LJXyl3uzbRZwRnZzfQ06yG3EodkPktyoABdSDHwiwvIJyPqkDjxqFX76KyFaQ QLmlWQU+qtaSTR2Q0fk1bZ/fQaeH9HdsXlZ52xnz/dgbri4vLwfa5cgWWRFLlK4cWQGO DhXA== X-Gm-Message-State: AO0yUKVAWQ9op8kBfrLa9xQAhI8WmhelfYqgtSLsR8AhT9vtwC6FOuyN Y7t+/ziPdFECaR7InA2DpLb5s7MqPS8= X-Google-Smtp-Source: AK7set+1eDUZHWt9kZPJxk0WB50JHjNR17+wyT64dcUFmi8qRKsNu2PaC1W91/S9/rX+CTaS8dKkBw== X-Received: by 2002:a17:903:2290:b0:19a:c65d:f90 with SMTP id b16-20020a170903229000b0019ac65d0f90mr45278922plh.44.1678740318350; Mon, 13 Mar 2023 13:45:18 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:47c6:db6e:4562:ae83]) by smtp.gmail.com with ESMTPSA id u15-20020a17090a400f00b00233864f21a7sm248659pjc.51.2023.03.13.13.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 13:45:17 -0700 (PDT) From: Max Filippov To: gcc-patches@gcc.gnu.org Cc: Max Filippov Subject: [COMMITTED] xtensa: add .note.GNU-stack section on linux Date: Mon, 13 Mar 2023 13:45:10 -0700 Message-Id: <20230313204510.1908188-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,GIT_PATCH_0,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,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 List-Id: gcc/ * config/xtensa/linux.h (TARGET_ASM_FILE_END): New macro. libgcc/ * config/xtensa/crti.S: Add .note.GNU-stack section on linux. * config/xtensa/crtn.S: Likewise. * config/xtensa/lib1funcs.S: Likewise. * config/xtensa/lib2funcs.S: Likewise. --- gcc/config/xtensa/linux.h | 2 ++ libgcc/config/xtensa/crti.S | 6 ++++++ libgcc/config/xtensa/crtn.S | 6 ++++++ libgcc/config/xtensa/lib1funcs.S | 6 ++++++ libgcc/config/xtensa/lib2funcs.S | 6 ++++++ 5 files changed, 26 insertions(+) diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h index dc4d547fc5fd..e684e7deebf9 100644 --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -69,3 +69,5 @@ along with GCC; see the file COPYING3. If not see #define XTENSA_ALWAYS_PIC 1 #undef DEBUGGER_REGNO + +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack diff --git a/libgcc/config/xtensa/crti.S b/libgcc/config/xtensa/crti.S index b88df50207b6..637203500c41 100644 --- a/libgcc/config/xtensa/crti.S +++ b/libgcc/config/xtensa/crti.S @@ -26,6 +26,12 @@ #include "xtensa-config-builtin.h" +/* An executable stack is *not* required for these functions. */ +#if defined(__ELF__) && defined(__linux__) +.section .note.GNU-stack,"",%progbits +.previous +#endif + .section .init .globl _init .type _init,@function diff --git a/libgcc/config/xtensa/crtn.S b/libgcc/config/xtensa/crtn.S index 7f271660f942..15c13ea03d0d 100644 --- a/libgcc/config/xtensa/crtn.S +++ b/libgcc/config/xtensa/crtn.S @@ -27,6 +27,12 @@ #include "xtensa-config-builtin.h" +/* An executable stack is *not* required for these functions. */ +#if defined(__ELF__) && defined(__linux__) +.section .note.GNU-stack,"",%progbits +.previous +#endif + .section .init #if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__ retw diff --git a/libgcc/config/xtensa/lib1funcs.S b/libgcc/config/xtensa/lib1funcs.S index a3f17b6b2cbc..5baf2df1d20e 100644 --- a/libgcc/config/xtensa/lib1funcs.S +++ b/libgcc/config/xtensa/lib1funcs.S @@ -25,6 +25,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "xtensa-config-builtin.h" +/* An executable stack is *not* required for these functions. */ +#if defined(__ELF__) && defined(__linux__) +.section .note.GNU-stack,"",%progbits +.previous +#endif + /* Define macros for the ABS and ADDX* instructions to handle cases where they are not included in the Xtensa processor configuration. */ diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S index e038e41eb6f1..992f712238c4 100644 --- a/libgcc/config/xtensa/lib2funcs.S +++ b/libgcc/config/xtensa/lib2funcs.S @@ -25,6 +25,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "xtensa-config-builtin.h" +/* An executable stack is *not* required for these functions. */ +#if defined(__ELF__) && defined(__linux__) +.section .note.GNU-stack,"",%progbits +.previous +#endif + /* __xtensa_libgcc_window_spill: This function flushes out all but the current register window. This is used to set up the stack so that arbitrary frames can be accessed. */ -- 2.30.2