]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / Python / GenPatchPcdTable / GenPatchPcdTable.py
index 1be0a28177ff8c39f001629c93d8a84c883d897f..d962ab0adda73f9e0e3a5edaff32384dd3c3fcb3 100644 (file)
@@ -6,13 +6,7 @@
 #    ========    ================\r
 #\r
 # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 #\r
 \r
@@ -55,20 +49,23 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath):
 \r
     if len(lines) == 0: return None\r
     firstline = lines[0].strip()\r
+    if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firstline):\r
+        return _parseForXcodeAndClang9(lines, efifilepath)\r
     if (firstline.startswith("Archive member included ") and\r
         firstline.endswith(" file (symbol)")):\r
         return _parseForGCC(lines, efifilepath)\r
     if firstline.startswith("# Path:"):\r
-        return _parseForXcode(lines, efifilepath)\r
+        return _parseForXcodeAndClang9(lines, efifilepath)\r
     return _parseGeneral(lines, efifilepath)\r
 \r
-def _parseForXcode(lines, efifilepath):\r
+def _parseForXcodeAndClang9(lines, efifilepath):\r
     valuePattern = re.compile('^([\da-fA-FxX]+)([\s\S]*)([_]*_gPcd_BinaryPatch_([\w]+))')\r
     status = 0\r
     pcds = []\r
     for line in lines:\r
         line = line.strip()\r
-        if status == 0 and line == "# Symbols:":\r
+        if status == 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', line) \\r
+            or line == "# Symbols:"):\r
             status = 1\r
             continue\r
         if status == 1 and len(line) != 0:\r