summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds/DataSection.py
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-06-28 09:33:10 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-06-28 09:33:10 +0000
commit9053bc517ea77b9780830bf08b966979eff1cb0f (patch)
tree960bef933abdad405b30af68375d4743e98b80c5 /BaseTools/Source/Python/GenFds/DataSection.py
parent96dd57ee8d5deb549310c4fbd4e4b5c7a810a928 (diff)
downloadedk2-platforms-9053bc517ea77b9780830bf08b966979eff1cb0f.tar.xz
Sync EDKII BaseTools to BaseTools project r1988
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10607 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/GenFds/DataSection.py')
-rw-r--r--BaseTools/Source/Python/GenFds/DataSection.py9
1 files changed, 9 insertions, 0 deletions
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: