mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
BaseTools: Update GenFw tool to support -e -z option together
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1727 -e -z option is to generate EFI image with zero debug entry. It can be used to check the EFI image in DEBUG build. This fix also supports the case -t -z option together for TE image. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Feng Bob C <bob.c.feng@intel.com>
This commit is contained in:
parent
48d49ea507
commit
fa5e184327
@ -1111,6 +1111,7 @@ Returns:
|
|||||||
time_t InputFileTime;
|
time_t InputFileTime;
|
||||||
time_t OutputFileTime;
|
time_t OutputFileTime;
|
||||||
struct stat Stat_Buf;
|
struct stat Stat_Buf;
|
||||||
|
BOOLEAN ZeroDebugFlag;
|
||||||
|
|
||||||
SetUtilityName (UTILITY_NAME);
|
SetUtilityName (UTILITY_NAME);
|
||||||
|
|
||||||
@ -1158,6 +1159,7 @@ Returns:
|
|||||||
NegativeAddr = FALSE;
|
NegativeAddr = FALSE;
|
||||||
InputFileTime = 0;
|
InputFileTime = 0;
|
||||||
OutputFileTime = 0;
|
OutputFileTime = 0;
|
||||||
|
ZeroDebugFlag = FALSE;
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
Error (NULL, 0, 1001, "Missing options", "No input options.");
|
Error (NULL, 0, 1001, "Missing options", "No input options.");
|
||||||
@ -1197,6 +1199,9 @@ Returns:
|
|||||||
goto Finish;
|
goto Finish;
|
||||||
}
|
}
|
||||||
ModuleType = argv[1];
|
ModuleType = argv[1];
|
||||||
|
if (mOutImageType == FW_ZERO_DEBUG_IMAGE) {
|
||||||
|
ZeroDebugFlag = TRUE;
|
||||||
|
}
|
||||||
if (mOutImageType != FW_TE_IMAGE) {
|
if (mOutImageType != FW_TE_IMAGE) {
|
||||||
mOutImageType = FW_EFI_IMAGE;
|
mOutImageType = FW_EFI_IMAGE;
|
||||||
}
|
}
|
||||||
@ -1220,6 +1225,9 @@ Returns:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--terse") == 0)) {
|
if ((stricmp (argv[0], "-t") == 0) || (stricmp (argv[0], "--terse") == 0)) {
|
||||||
|
if (mOutImageType == FW_ZERO_DEBUG_IMAGE) {
|
||||||
|
ZeroDebugFlag = TRUE;
|
||||||
|
}
|
||||||
mOutImageType = FW_TE_IMAGE;
|
mOutImageType = FW_TE_IMAGE;
|
||||||
argc --;
|
argc --;
|
||||||
argv ++;
|
argv ++;
|
||||||
@ -1241,7 +1249,12 @@ Returns:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((stricmp (argv[0], "-z") == 0) || (stricmp (argv[0], "--zero") == 0)) {
|
if ((stricmp (argv[0], "-z") == 0) || (stricmp (argv[0], "--zero") == 0)) {
|
||||||
mOutImageType = FW_ZERO_DEBUG_IMAGE;
|
if (mOutImageType == FW_DUMMY_IMAGE) {
|
||||||
|
mOutImageType = FW_ZERO_DEBUG_IMAGE;
|
||||||
|
}
|
||||||
|
if (mOutImageType == FW_TE_IMAGE || mOutImageType == FW_EFI_IMAGE) {
|
||||||
|
ZeroDebugFlag = TRUE;
|
||||||
|
}
|
||||||
argc --;
|
argc --;
|
||||||
argv ++;
|
argv ++;
|
||||||
continue;
|
continue;
|
||||||
@ -2588,7 +2601,7 @@ Returns:
|
|||||||
//
|
//
|
||||||
// Zero Time/Data field
|
// Zero Time/Data field
|
||||||
//
|
//
|
||||||
ZeroDebugData (FileBuffer, FALSE);
|
ZeroDebugData (FileBuffer, ZeroDebugFlag);
|
||||||
|
|
||||||
if (mOutImageType == FW_TE_IMAGE) {
|
if (mOutImageType == FW_TE_IMAGE) {
|
||||||
if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type &~0xFF)) {
|
if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type &~0xFF)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user