MdePkg/PeCoffLib: Capture DLL characteristics fields in image context
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4405 When loading a PE/COFF image, capture the DLL characteristics fields of the header into our image context structure so we can refer to them when mapping the image. 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>
This commit is contained in:
committed by
mergify[bot]
parent
b62d7ac97b
commit
d6457b3090
@@ -625,7 +625,8 @@ typedef struct {
|
||||
UINT32 FileOffset; ///< The file pointer to the debug data.
|
||||
} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
|
||||
|
||||
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2 ///< The Visual C++ debug information.
|
||||
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2 ///< The Visual C++ debug information.
|
||||
#define EFI_IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS 20
|
||||
|
||||
///
|
||||
/// Debug Data Structure defined in Microsoft C++.
|
||||
@@ -669,6 +670,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;
|
||||
|
||||
///
|
||||
/// Resource format.
|
||||
///
|
||||
|
@@ -171,6 +171,12 @@ typedef struct {
|
||||
///
|
||||
UINT16 ImageType;
|
||||
///
|
||||
/// Set by PeCoffLoaderGetImageInfo() to the DLL flags stored in the PE/COFF header and
|
||||
/// in the DllCharacteristicsEx debug table.
|
||||
///
|
||||
UINT16 DllCharacteristics;
|
||||
UINT32 DllCharacteristicsEx;
|
||||
///
|
||||
/// Set by PeCoffLoaderGetImageInfo() to TRUE if the PE/COFF image does not contain
|
||||
/// relocation information.
|
||||
///
|
||||
|
Reference in New Issue
Block a user