[efi] Set NXCOMPAT bit in PE header

Indicate that the binary is compatible with W^X protections by setting
the NXCOMPAT bit in the DllCharacteristics field of the PE header.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/1082/head
Michael Brown 2023-11-22 23:36:35 +00:00
parent 678a60f61d
commit a9e89787d0
1 changed files with 2 additions and 0 deletions

View File

@ -225,6 +225,8 @@ static struct pe_header efi_pe_header = {
.FileAlignment = EFI_FILE_ALIGN,
.SizeOfImage = EFI_IMAGE_ALIGN,
.SizeOfHeaders = sizeof ( efi_pe_header ),
.DllCharacteristics =
IMAGE_DLLCHARACTERISTICS_NX_COMPAT,
.NumberOfRvaAndSizes = NUMBER_OF_DIRECTORY_ENTRIES,
},
},