## @ PatchFv.py\r
#\r
-# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>\r
# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
##\r
match = re.match("^EFI_BASE_ADDRESS\s*=\s*(0x[a-fA-F0-9]+)", rptLine)\r
if match is not None:\r
self.fdBase = int(match.group(1), 16) - fvOffset\r
+ break\r
rptLine = fdIn.readline()\r
fdIn.close()\r
if self.fdBase == 0xFFFFFFFF:\r
- raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" % fvFile)\r
+ raise Exception("Could not find EFI_BASE_ADDRESS in INF file!" % infFile)\r
return 0\r
\r
#\r
#\r
# retval 0 Parsed MOD MAP file successfully\r
# retval 1 There is no moduleEntryPoint in modSymbols\r
+ # retval 2 There is no offset for moduleEntryPoint in modSymbols\r
#\r
def parseModMapFile(self, moduleName, mapFile):\r
#\r
else:\r
#MSFT\r
#0003:00000190 _gComBase 00007a50 SerialPo\r
- patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}\s+(\w+)\s+([0-9a-fA-F]{8}\s+)"\r
+ patchMapFileMatchString = "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}\s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)"\r
matchKeyGroupIndex = 1\r
matchSymbolGroupIndex = 2\r
prefix = ''\r
continue\r
\r
if not moduleEntryPoint in modSymbols:\r
- return 1\r
+ if matchSymbolGroupIndex == 2:\r
+ if not '_ModuleEntryPoint' in modSymbols:\r
+ return 1\r
+ else:\r
+ moduleEntryPoint = "_ModuleEntryPoint"\r
+ else:\r
+ return 1\r
\r
modEntry = '%s:%s' % (moduleName,moduleEntryPoint)\r
if not modEntry in self.dictSymbolAddress:\r
#\r
# Get current character\r
#\r
- # retval elf.string[self.index]\r
+ # retval self.string[self.index]\r
# retval '' Exception\r
#\r
def getCurr(self):\r