mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
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:
parent
72b65146bf
commit
c5811ef1b3
@ -266,13 +266,14 @@ def BuildUniversalPayload(Args):
|
||||
#
|
||||
RelocBinary = b''
|
||||
PeCoff = pefile.PE (TargetRebaseFile)
|
||||
for reloc in PeCoff.DIRECTORY_ENTRY_BASERELOC:
|
||||
for entry in reloc.entries:
|
||||
if (entry.type == 0):
|
||||
continue
|
||||
Type = entry.type
|
||||
Offset = entry.rva + fit_image_info_header.DataOffset
|
||||
RelocBinary += Offset.to_bytes (8, 'little') + Type.to_bytes (8, 'little')
|
||||
if hasattr(PeCoff, 'DIRECTORY_ENTRY_BASERELOC'):
|
||||
for reloc in PeCoff.DIRECTORY_ENTRY_BASERELOC:
|
||||
for entry in reloc.entries:
|
||||
if (entry.type == 0):
|
||||
continue
|
||||
Type = entry.type
|
||||
Offset = entry.rva + fit_image_info_header.DataOffset
|
||||
RelocBinary += Offset.to_bytes (8, 'little') + Type.to_bytes (8, 'little')
|
||||
RelocBinary += b'\x00' * (0x1000 - (len(RelocBinary) % 0x1000))
|
||||
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user