diff options
author | Zhiguang Liu <zhiguang.liu@intel.com> | 2019-10-29 13:07:44 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-11-08 08:29:36 +0800 |
commit | 5cef92771fb966b6ebe5eccbd97c2127c091b4e9 (patch) | |
tree | abd47ff16fa4cfa6db847384ecd07c4ed56333db /BaseTools/Source/Python/Common/Misc.py | |
parent | 601a18bf08ca815544b2223208b437a83fba6858 (diff) | |
download | edk2-5cef92771fb966b6ebe5eccbd97c2127c091b4e9.tar.gz edk2-5cef92771fb966b6ebe5eccbd97c2127c091b4e9.tar.bz2 edk2-5cef92771fb966b6ebe5eccbd97c2127c091b4e9.zip |
BaseTools: Add map file parsing support for CLANG9
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/Misc.py')
-rwxr-xr-x | BaseTools/Source/Python/Common/Misc.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index a488536cb4..da5fb380f0 100755 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -81,19 +81,22 @@ def GetVariableOffset(mapfilepath, efifilepath, varnames): if len(lines) == 0: return None
firstline = lines[0].strip()
+ if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline):
+ return _parseForXcodeAndClang9(lines, efifilepath, varnames)
if (firstline.startswith("Archive member included ") and
firstline.endswith(" file (symbol)")):
return _parseForGCC(lines, efifilepath, varnames)
if firstline.startswith("# Path:"):
- return _parseForXcode(lines, efifilepath, varnames)
+ return _parseForXcodeAndClang9(lines, efifilepath, varnames)
return _parseGeneral(lines, efifilepath, varnames)
-def _parseForXcode(lines, efifilepath, varnames):
+def _parseForXcodeAndClang9(lines, efifilepath, varnames):
status = 0
ret = []
for line in lines:
line = line.strip()
- if status == 0 and line == "# Symbols:":
+ if status == 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \
+ or line == "# Symbols:"):
status = 1
continue
if status == 1 and len(line) != 0:
|