From 7cde2cc52f19f733de7855419d1c43a13a8d6c5f Mon Sep 17 00:00:00 2001 From: Dennis Tseng Date: Fri, 28 Apr 2023 10:47:33 +0800 Subject: post-process-pe: add tests to validate NX compliance This changes post-process-pe to give warnings, and optionally errors, if a shim binary is built with Section Alignment or characteristics are not compatible with NX, or if the EFI_IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag is not set and require_nx_compat is true. Co-authored-by: Peter Jones Co-authored-by: Kamil Aronowski Signed-off-by: Dennis Tseng --- include/peimage.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/peimage.h') diff --git a/include/peimage.h b/include/peimage.h index 6eef1051..4182a17b 100644 --- a/include/peimage.h +++ b/include/peimage.h @@ -824,6 +824,7 @@ typedef struct { EFI_IMAGE_DATA_DIRECTORY *RelocDir; EFI_IMAGE_DATA_DIRECTORY *SecDir; UINT64 NumberOfRvaAndSizes; + UINT16 DllCharacteristics; EFI_IMAGE_OPTIONAL_HEADER_UNION *PEHdr; } PE_COFF_LOADER_IMAGE_CONTEXT; -- cgit v1.2.3