UefiPayloadPkg: Enhance universal payload build

If there is no relocation in the payload it would build failure.
This will fix the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>
This commit is contained in:
Guo Dong 2024-11-19 15:46:11 -07:00 committed by mergify[bot]
parent 72b65146bf
commit c5811ef1b3

View File

@ -266,6 +266,7 @@ def BuildUniversalPayload(Args):
# #
RelocBinary = b'' RelocBinary = b''
PeCoff = pefile.PE (TargetRebaseFile) PeCoff = pefile.PE (TargetRebaseFile)
if hasattr(PeCoff, 'DIRECTORY_ENTRY_BASERELOC'):
for reloc in PeCoff.DIRECTORY_ENTRY_BASERELOC: for reloc in PeCoff.DIRECTORY_ENTRY_BASERELOC:
for entry in reloc.entries: for entry in reloc.entries:
if (entry.type == 0): if (entry.type == 0):