public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-3705] RISC-V: Emit .note.GNU-stack for non-linux target as well
@ 2023-09-05 12:12 Kito Cheng
  0 siblings, 0 replies; only message in thread
From: Kito Cheng @ 2023-09-05 12:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fba0f47e4617e164716d3bce587fc6948088e225

commit r14-3705-gfba0f47e4617e164716d3bce587fc6948088e225
Author: Kito Cheng <kito.cheng@sifive.com>
Date:   Wed Aug 30 15:10:44 2023 +0800

    RISC-V: Emit .note.GNU-stack for non-linux target as well
    
    We only emit that on linux target before, that not problem before,
    however Qemu has fix a bug to make qemu user mode honor PT_GNU_STACK[1],
    that will cause problem when we test baremetal with qemu.
    
    So the straightforward is enable that as well for non-linux toolchian,
    the price is that will increase few bytes for each binary.
    
    [1] https://github.com/qemu/qemu/commit/872f3d046f2381e3f416519e82df96bd60818311
    
    gcc/ChangeLog:
    
            * config/riscv/linux.h (TARGET_ASM_FILE_END): Move ...
            * config/riscv/riscv.cc (TARGET_ASM_FILE_END): to here.

Diff:
---
 gcc/config/riscv/linux.h  | 2 --
 gcc/config/riscv/riscv.cc | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 3e625e0f8676..7323ff30f703 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -59,8 +59,6 @@ along with GCC; see the file COPYING3.  If not see
       -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
     %{static:-static}}"
 
-#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
-
 #define STARTFILE_PREFIX_SPEC 			\
    "/lib" XLEN_SPEC "/" ABI_SPEC "/ "		\
    "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ "	\
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 8d8f7b4f16ed..2db9c81ac8b0 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -9109,6 +9109,8 @@ riscv_vectorize_create_costs (vec_info *vinfo, bool costing_for_scalar)
 #define TARGET_ASM_FILE_START riscv_file_start
 #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
 #undef TARGET_EXPAND_BUILTIN_VA_START
 #define TARGET_EXPAND_BUILTIN_VA_START riscv_va_start

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-05 12:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-05 12:12 [gcc r14-3705] RISC-V: Emit .note.GNU-stack for non-linux target as well Kito Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).