X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FDataSection.py;h=0f41953ad42f6c2ba1a8fd825ed2f2c5b5c569c5;hp=dff4691462f177e7683685e18a47806859808971;hb=9053bc517ea77b9780830bf08b966979eff1cb0f;hpb=96dd57ee8d5deb549310c4fbd4e4b5c7a810a928 diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Source/Python/GenFds/DataSection.py index dff4691462..0f41953ad4 100644 --- a/BaseTools/Source/Python/GenFds/DataSection.py +++ b/BaseTools/Source/Python/GenFds/DataSection.py @@ -21,6 +21,7 @@ import subprocess from Ffs import Ffs import os from CommonDataClass.FdfClass import DataSectionClassObject +from Common.Misc import PeImageClass import shutil ## generate data section @@ -74,6 +75,14 @@ class DataSection (DataSectionClassObject): (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)): shutil.copyfile(MapFile, CopyMapFile) + #Get PE Section alignment when align is set to AUTO + if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'): + ImageObj = PeImageClass (Filename) + if ImageObj.SectionAlignment < 0x400: + self.Alignment = str (ImageObj.SectionAlignment) + else: + self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K' + NoStrip = True if self.SecType in ('TE', 'PE32'): if self.KeepReloc != None: