[PATCH 1/1] loongarch: efi: Set NX compat flag in PE/COFF header
From: Heinrich Schuchardt
Date: Sun Sep 20 2026 - 05:20:29 EST
The flag IMAGE_DLLCHARACTERISTICS_NX_COMPAT informs the firmware that the
EFI binary does not rely on pages that are both executable and writable.
As the Linux kernel neither has RWX sections nor needs RWX pages for
relocation we should set the flag.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@xxxxxxxxxxxxx>
---
arch/loongarch/kernel/efi-header.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/kernel/efi-header.S b/arch/loongarch/kernel/efi-header.S
index 6df56241cb95a..c041dad5bbb6c 100644
--- a/arch/loongarch/kernel/efi-header.S
+++ b/arch/loongarch/kernel/efi-header.S
@@ -51,7 +51,7 @@
.long .Lefi_header_end - _head /* SizeOfHeaders */
.long 0 /* CheckSum */
.short IMAGE_SUBSYSTEM_EFI_APPLICATION /* Subsystem */
- .short 0 /* DllCharacteristics */
+ .short IMAGE_DLLCHARACTERISTICS_NX_COMPAT /* DllCharacteristics */
.quad 0 /* SizeOfStackReserve */
.quad 0 /* SizeOfStackCommit */
.quad 0 /* SizeOfHeapReserve */
--
2.53.0