EFI: Add Data Directory space

Currently, the PE headers we create in boot/header.S do not allocate
space for any Data Directory entries, as they haven't been needed.

In order to support signatures and compatibility with some loaders, we
need the Data Directory to be populated at least enough to set
DataDirectory.Certs and DataDirectory.BaseReloc.

This patch extends that space enough to include those entries.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2022-03-31 13:26:24 -04:00 committed by Sam Demeulemeester
parent e3c0d6df60
commit 3dd1fa8959

View File

@ -163,7 +163,20 @@ extra_header_fields:
.long 0 # SizeOfHeapCommit
#endif
.long 0 # LoaderFlags
.long 0 # NumberOfRvaAndSizes
.long IMAGE_DIRECTORY_ENTRY_DEBUG # NumberOfRvaAndSizes
.long 0 # DataDirectory.Export.VirtualAddress
.long 0 # DataDirectory.Export.Size
.long 0 # DataDirectory.Import.VirtualAddress
.long 0 # DataDirectory.Import.Size
.long 0 # DataDirectory.Resource.VirtualAddress
.long 0 # DataDirectory.Resource.Size
.long 0 # DataDirectory.Exception.VirtualAddress
.long 0 # DataDirectory.Exception.Size
.long 0 # DataDirectory.Certs.VirtualAddress
.long 0 # DataDirectory.Certs.Size
.long 0 # DataDirectory.BaseReloc.VirtualAddress
.long 0 # DataDirectory.BaseReloc.Size
# Section table
section_table: