public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelFsp2Pkg/Tools: PatchFv: Handle 32-bit address in GCC map
@ 2023-05-31  3:48 Jiaqing Zhao
  0 siblings, 0 replies; only message in thread
From: Jiaqing Zhao @ 2023-05-31  3:48 UTC (permalink / raw)
  To: devel; +Cc: Jiaqing Zhao

Some versions of ld (like 2.40 in Ubuntu 23.04) uses 32-bit address
when generating map files for IA32 build. This patch enables PatchFv.py
to parse these 32-bit addresses in GCC map properly.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
---
 IntelFsp2Pkg/Tools/PatchFv.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py
index 73ab877c71..2e60343180 100644
--- a/IntelFsp2Pkg/Tools/PatchFv.py
+++ b/IntelFsp2Pkg/Tools/PatchFv.py
@@ -432,7 +432,8 @@ class Symbols:
         if reportLine.strip().find("Archive member included") != -1:
             #GCC
             #                0x0000000000001d55                IoRead8
-            patchMapFileMatchString = "\s+(0x[0-9a-fA-F]{16})\s+([^\s][^0x][_a-zA-Z0-9\-]+)\s"
+            #                0x00001d55                IoRead8
+            patchMapFileMatchString = "\s+(0x[0-9a-fA-F]{8,16})\s+([^\s][^0x][_a-zA-Z0-9\-]+)\s"
             matchKeyGroupIndex = 2
             matchSymbolGroupIndex  = 1
             prefix = '_'
@@ -458,7 +459,7 @@ class Symbols:
                 if handleNext:
                     handleNext = False
                     pcdName = match.group(1)
-                    match   = re.match("\s+(0x[0-9a-fA-F]{16})\s+", reportLine)
+                    match   = re.match("\s+(0x[0-9a-fA-F]{8,16})\s+", reportLine)
                     if match is not None:
                         modSymbols[prefix + pcdName] = match.group(1)
                 else:
-- 
2.39.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-31  3:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-31  3:48 [PATCH] IntelFsp2Pkg/Tools: PatchFv: Handle 32-bit address in GCC map Jiaqing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox