[edk2-devel] [PATCH] BaseTools: Fix binary file not generate map file issue

Feng, YunhuaX posted 1 patch 3 years, 11 months ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/GenFds/EfiSection.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [PATCH] BaseTools: Fix binary file not generate map file issue
Posted by Feng, YunhuaX 3 years, 11 months ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2624

When EFI file come from binary file, not generate .map file, so need ignore the map file.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
---
 BaseTools/Source/Python/GenFds/EfiSection.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py
index db892df345..e7d4639041 100644
--- a/BaseTools/Source/Python/GenFds/EfiSection.py
+++ b/BaseTools/Source/Python/GenFds/EfiSection.py
@@ -266,11 +266,11 @@ class EfiSection (EfiSectionClassObject):
                         elif ImageObj.SectionAlignment < 0x100000:
                             Align = str (ImageObj.SectionAlignment // 0x400) + 'K'
                         else:
                             Align = str (ImageObj.SectionAlignment // 0x100000) + 'M'

-                    if File[(len(File)-4):] == '.efi':
+                    if File[(len(File)-4):] == '.efi' and FfsInf.InfModule.BaseName == os.path.basename(File)[:-4]:
                         MapFile = File.replace('.efi', '.map')
                         CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
                         if IsMakefile:
                             if GenFdsGlobalVariable.CopyList == []:
                                 GenFdsGlobalVariable.CopyList = [(MapFile, CopyMapFile)]
--
2.12.2.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#58954): https://edk2.groups.io/g/devel/message/58954
Mute This Topic: https://groups.io/mt/74092404/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH] BaseTools: Fix binary file not generate map file issue
Posted by Bob Feng 3 years, 11 months ago
This patch looks fine.

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Feng, YunhuaX <yunhuax.feng@intel.com> 
Sent: Saturday, May 9, 2020 5:34 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH] BaseTools: Fix binary file not generate map file issue

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2624

When EFI file come from binary file, not generate .map file, so need ignore the map file.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
---
 BaseTools/Source/Python/GenFds/EfiSection.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py
index db892df345..e7d4639041 100644
--- a/BaseTools/Source/Python/GenFds/EfiSection.py
+++ b/BaseTools/Source/Python/GenFds/EfiSection.py
@@ -266,11 +266,11 @@ class EfiSection (EfiSectionClassObject):
                         elif ImageObj.SectionAlignment < 0x100000:
                             Align = str (ImageObj.SectionAlignment // 0x400) + 'K'
                         else:
                             Align = str (ImageObj.SectionAlignment // 0x100000) + 'M'
 
-                    if File[(len(File)-4):] == '.efi':
+                    if File[(len(File)-4):] == '.efi' and FfsInf.InfModule.BaseName == os.path.basename(File)[:-4]:
                         MapFile = File.replace('.efi', '.map')
                         CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
                         if IsMakefile:
                             if GenFdsGlobalVariable.CopyList == []:
                                 GenFdsGlobalVariable.CopyList = [(MapFile, CopyMapFile)]
-- 
2.12.2.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#59391): https://edk2.groups.io/g/devel/message/59391
Mute This Topic: https://groups.io/mt/74092404/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-