|
From: <yi...@us...> - 2013-01-25 06:09:16
|
Revision: 2570
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2570&view=rev
Author: yingke
Date: 2013-01-25 06:09:07 +0000 (Fri, 25 Jan 2013)
Log Message:
-----------
1. The EFI files with section type PE or PE32 are stripped if RELOCS_STRIPPED is present at FILE statement scope in FV section of FDF;
2. Correct version type (0x14) for VERSION section in FILE statement.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/GenFds/FdfParser.py
trunk/BaseTools/Source/Python/GenFds/FfsFileStatement.py
trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
trunk/BaseTools/Source/Python/GenFds/VerSection.py
Modified: trunk/BaseTools/Source/Python/GenFds/FdfParser.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2013-01-22 05:43:53 UTC (rev 2569)
+++ trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2013-01-25 06:09:07 UTC (rev 2570)
@@ -2503,16 +2503,16 @@
self.__GetFileOpts( FfsFileObj)
if not self.__IsToken("{"):
-# if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
-# if self.__FileCouldHaveRelocFlag(FfsFileObj.FvFileType):
-# if self.__Token == 'RELOCS_STRIPPED':
-# FfsFileObj.KeepReloc = False
-# else:
-# FfsFileObj.KeepReloc = True
-# else:
-# raise Warning("File type %s could not have reloc strip flag%d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
-#
-# if not self.__IsToken("{"):
+ if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
+ if self.__FileCouldHaveRelocFlag(FfsFileObj.FvFileType):
+ if self.__Token == 'RELOCS_STRIPPED':
+ FfsFileObj.KeepReloc = False
+ else:
+ FfsFileObj.KeepReloc = True
+ else:
+ raise Warning("File type %s could not have reloc strip flag%d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
+
+ if not self.__IsToken("{"):
raise Warning("expected '{'", self.FileName, self.CurrentLineNumber)
if not self.__GetNextToken():
Modified: trunk/BaseTools/Source/Python/GenFds/FfsFileStatement.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/FfsFileStatement.py 2013-01-22 05:43:53 UTC (rev 2569)
+++ trunk/BaseTools/Source/Python/GenFds/FfsFileStatement.py 2013-01-25 06:09:07 UTC (rev 2570)
@@ -110,6 +110,8 @@
if FvParentAddr != None and isinstance(section, GuidSection):
section.FvParentAddr = FvParentAddr
+ if self.KeepReloc == False:
+ section.KeepReloc = False
sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)
if sectList != []:
for sect in sectList:
Modified: trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 2013-01-22 05:43:53 UTC (rev 2569)
+++ trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 2013-01-25 06:09:07 UTC (rev 2570)
@@ -345,7 +345,7 @@
@staticmethod
def GenerateSection(Output, Input, Type=None, CompressionType=None, Guid=None,
- GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None):
+ GuidHdrLen=None, GuidAttr=[], Ui=None, Ver=None, InputAlign=None, BuildNumber=None):
Cmd = ["GenSec"]
if Type not in [None, '']:
Cmd += ["-s", Type]
@@ -374,14 +374,11 @@
GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15)
SaveFileOnChange(Output, SectionData.tostring())
elif Ver not in [None, '']:
- #Cmd += ["-j", Ver]
- SectionData = array.array('B', [0,0,0,0])
- SectionData.fromstring(Ver.encode("utf_16_le"))
- SectionData.append(0)
- SectionData.append(0)
- Len = len(SectionData)
- GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x14)
- SaveFileOnChange(Output, SectionData.tostring())
+ Cmd += ["-n", Ver]
+ if BuildNumber:
+ Cmd += ["-j", BuildNumber]
+ Cmd += ["-o", Output]
+ GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section")
else:
Cmd += ["-o", Output]
Cmd += Input
Modified: trunk/BaseTools/Source/Python/GenFds/VerSection.py
===================================================================
--- trunk/BaseTools/Source/Python/GenFds/VerSection.py 2013-01-22 05:43:53 UTC (rev 2569)
+++ trunk/BaseTools/Source/Python/GenFds/VerSection.py 2013-01-25 06:09:07 UTC (rev 2570)
@@ -76,7 +76,7 @@
StringData = ''
GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTION_VERSION',
- Ui=StringData, Ver=self.BuildNum)
+ Ver=StringData, BuildNumber=self.BuildNum)
OutputFileList = []
OutputFileList.append(OutputFile)
return OutputFileList, self.Alignment
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|