From a8d52f9a9b7be90decc6eabae39ec360bda5cd15 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Tue, 12 Jul 2022 08:11:53 +0200
Subject: [PATCH] efi_loader: suppress executable stack warning

When linking EFI binaries the linker emits:

    ld.bfd: warning: lib/efi_loader/efi_crt0.o:
    missing .note.GNU-stack section implies executable stack

Suppress the warning.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 scripts/Makefile.lib | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index c0a5bb9add..8e13bf2b98 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -426,8 +426,8 @@ $(obj)/%.efi: $(obj)/%_efi.so
 	$(call cmd,efi_objcopy)
 
 quiet_cmd_efi_ld = LD      $@
-cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \
-		-Bsymbolic -znorelro -s $^ -o $@
+cmd_efi_ld = $(LD) -nostdlib -zexecstack -znocombreloc -T $(EFI_LDS_PATH) \
+		-shared -Bsymbolic -znorelro -s $^ -o $@
 
 EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
 
-- 
2.39.5