From 803b49c40bb0b720b90d9c31d372911f1b946aa7 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 6 Aug 2022 11:16:29 +0100 Subject: */*.S: add non-executable GNU stack marking on ELF-linux binutils-2.39 enabed a few warning by default (https://sourceware.org/pipermail/binutils/2022-August/122246.html): > The ELF linker will now generate a warning message if the stack is made executable. Let's suppress the warnings in assembly files by adding non-executables stack markings. This fixes at least systemd build which uses '-Wl,--fatal-warnings': https://github.com/systemd/systemd/issues/24226 --- gnuefi/crt0-efi-aarch64.S | 4 ++++ gnuefi/crt0-efi-arm.S | 4 ++++ gnuefi/crt0-efi-ia32.S | 4 ++++ gnuefi/crt0-efi-ia64.S | 4 ++++ gnuefi/crt0-efi-mips64el.S | 4 ++++ gnuefi/crt0-efi-riscv64.S | 4 ++++ gnuefi/crt0-efi-x86_64.S | 3 +++ gnuefi/reloc_ia64.S | 4 ++++ 8 files changed, 31 insertions(+) (limited to 'gnuefi') diff --git a/gnuefi/crt0-efi-aarch64.S b/gnuefi/crt0-efi-aarch64.S index d50e78d..a0687b1 100644 --- a/gnuefi/crt0-efi-aarch64.S +++ b/gnuefi/crt0-efi-aarch64.S @@ -128,3 +128,7 @@ _start: 0: ldp x29, x30, [sp], #32 ret + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/crt0-efi-arm.S b/gnuefi/crt0-efi-arm.S index e7e5905..ea3bbc4 100644 --- a/gnuefi/crt0-efi-arm.S +++ b/gnuefi/crt0-efi-arm.S @@ -143,3 +143,7 @@ _start: .L_DYNAMIC: .word _DYNAMIC - . + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/crt0-efi-ia32.S b/gnuefi/crt0-efi-ia32.S index b1c9610..9e9c865 100644 --- a/gnuefi/crt0-efi-ia32.S +++ b/gnuefi/crt0-efi-ia32.S @@ -75,3 +75,7 @@ dummy: .long 0 .long 12 // Block Size (2*4+2*2), must be aligned by 32 Bits .word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy .word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/crt0-efi-ia64.S b/gnuefi/crt0-efi-ia64.S index cd00b8d..38af615 100644 --- a/gnuefi/crt0-efi-ia64.S +++ b/gnuefi/crt0-efi-ia64.S @@ -85,3 +85,7 @@ _start_plabel: data4 12 // Block Size (2*4+2*2), must be aligned by 32 Bits data2 (IMAGE_REL_BASED_DIR64<<12) + 0 // reloc for plabel's entry point data2 (IMAGE_REL_BASED_DIR64<<12) + 8 // reloc for plabel's global pointer + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/crt0-efi-mips64el.S b/gnuefi/crt0-efi-mips64el.S index 6d26f66..4b2c1b2 100644 --- a/gnuefi/crt0-efi-mips64el.S +++ b/gnuefi/crt0-efi-mips64el.S @@ -186,3 +186,7 @@ _pc: .end _start .set pop + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/crt0-efi-riscv64.S b/gnuefi/crt0-efi-riscv64.S index 1bc536b..0a5b7fc 100644 --- a/gnuefi/crt0-efi-riscv64.S +++ b/gnuefi/crt0-efi-riscv64.S @@ -134,3 +134,7 @@ _start: ld ra, 16(sp) 0: addi sp, sp, 24 ret + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/crt0-efi-x86_64.S b/gnuefi/crt0-efi-x86_64.S index 20bbaee..49f0a0d 100644 --- a/gnuefi/crt0-efi-x86_64.S +++ b/gnuefi/crt0-efi-x86_64.S @@ -75,3 +75,6 @@ label1: .word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy .word (IMAGE_REL_ABSOLUTE<<12) + 0 // reloc for dummy +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/gnuefi/reloc_ia64.S b/gnuefi/reloc_ia64.S index 40203bf..ce2bf6a 100644 --- a/gnuefi/reloc_ia64.S +++ b/gnuefi/reloc_ia64.S @@ -225,3 +225,7 @@ apply_FPTR64: fptr_mem_base: .space MAX_FUNCTION_DESCRIPTORS*16 fptr_mem_limit: + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif -- cgit v1.2.1