mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +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''
|
RelocBinary = b''
|
||||||
PeCoff = pefile.PE (TargetRebaseFile)
|
PeCoff = pefile.PE (TargetRebaseFile)
|
||||||
for reloc in PeCoff.DIRECTORY_ENTRY_BASERELOC:
|
if hasattr(PeCoff, 'DIRECTORY_ENTRY_BASERELOC'):
|
||||||
for entry in reloc.entries:
|
for reloc in PeCoff.DIRECTORY_ENTRY_BASERELOC:
|
||||||
if (entry.type == 0):
|
for entry in reloc.entries:
|
||||||
continue
|
if (entry.type == 0):
|
||||||
Type = entry.type
|
continue
|
||||||
Offset = entry.rva + fit_image_info_header.DataOffset
|
Type = entry.type
|
||||||
RelocBinary += Offset.to_bytes (8, 'little') + Type.to_bytes (8, 'little')
|
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))
|
RelocBinary += b'\x00' * (0x1000 - (len(RelocBinary) % 0x1000))
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user