diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-03-25 15:50:54 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-07 13:18:38 +0000 |
commit | b62d7ac97b67e192d45e02ec3554a52736c66dfa (patch) | |
tree | bec5f9da6b0da0b1fdb6db1a3de2bd5c96b1e6f4 /BaseTools/Source/C/Include | |
parent | 6c299acf48fde3811c027b6ceddd0c0eb97ba38f (diff) | |
download | edk2-b62d7ac97b67e192d45e02ec3554a52736c66dfa.zip edk2-b62d7ac97b67e192d45e02ec3554a52736c66dfa.tar.gz edk2-b62d7ac97b67e192d45e02ec3554a52736c66dfa.tar.bz2 |
BaseTools/GenFw: Add DllCharacteristicsEx field to debug data
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4405
The PE/COFF spec describes an additional DllCharacteristics field
implemented as a debug directory entry, which carries flags related to
which control flow integrity (CFI) features are supported by the binary.
So let's add this entry when doing ELF to PE/COFF conversion - we will
add support for setting the flags in a subsequent patch.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'BaseTools/Source/C/Include')
-rw-r--r-- | BaseTools/Source/C/Include/IndustryStandard/PeImage.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h index 77ded3f..22161ed 100644 --- a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h +++ b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h @@ -615,7 +615,8 @@ typedef struct { ///
/// Debug Format
///
-#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
+#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
+#define EFI_IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS 20
typedef struct {
UINT32 Characteristics;
@@ -664,6 +665,16 @@ typedef struct { //
} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
+///
+/// Extended DLL Characteristics
+///
+#define EFI_IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT 0x0001
+#define EFI_IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT 0x0040
+
+typedef struct {
+ UINT32 DllCharacteristicsEx;
+} EFI_IMAGE_DEBUG_EX_DLLCHARACTERISTICS_ENTRY;
+
//
// .pdata entries for X64
//
|