Sync BaseTools Branch (version r2362) to EDKII main trunk.
Signed-off-by: lgao4 Reviewed-by: jsu1 Reviewed-by: ydliu git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12525 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -124,6 +124,11 @@ Returns:
|
||||
Address is the rebase start address for drivers that\n\
|
||||
run in Flash. It supports DEC or HEX digital format.\n\
|
||||
If it is set to zero, no rebase action will be taken\n");
|
||||
fprintf (stdout, " -F ForceRebase, --force-rebase ForceRebase\n\
|
||||
If value is TRUE, will always take rebase action\n\
|
||||
If value is FALSE, will always not take reabse action\n\
|
||||
If not specified, will take rebase action if rebase address greater than zero, \n\
|
||||
will not take rebase action if rebase address is zero.\n");
|
||||
fprintf (stdout, " -a AddressFile, --addrfile AddressFile\n\
|
||||
AddressFile is one file used to record the child\n\
|
||||
FV base address when current FV base address is set.\n");
|
||||
@@ -231,6 +236,7 @@ Returns:
|
||||
// Set the default FvGuid
|
||||
//
|
||||
memcpy (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid, sizeof (EFI_GUID));
|
||||
mFvDataInfo.ForceRebase = -1;
|
||||
|
||||
//
|
||||
// Parse command line
|
||||
@@ -330,7 +336,7 @@ Returns:
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((stricmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {
|
||||
if ((strcmp (argv[0], "-f") == 0) || (stricmp (argv[0], "--ffsfile") == 0)) {
|
||||
if (argv[1] == NULL) {
|
||||
Error (NULL, 0, 1003, "Invalid option value", "Input Ffsfile can't be null");
|
||||
return STATUS_ERROR;
|
||||
@@ -372,6 +378,26 @@ Returns:
|
||||
argv ++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((strcmp (argv[0], "-F") == 0) || (stricmp (argv[0], "--force-rebase") == 0)) {
|
||||
if (argv[1] == NULL) {
|
||||
Error (NULL, 0, 1003, "Invalid option value", "Froce rebase flag can't be null");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
|
||||
if (stricmp (argv[1], "TRUE") == 0) {
|
||||
mFvDataInfo.ForceRebase = 1;
|
||||
} else if (stricmp (argv[1], "FALSE") == 0) {
|
||||
mFvDataInfo.ForceRebase = 0;
|
||||
} else {
|
||||
Error (NULL, 0, 1003, "Invalid option value", "froce rebase flag value must be \"TRUE\" or \"FALSE\"");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stricmp (argv[0], "--capheadsize") == 0) {
|
||||
//
|
||||
@@ -597,7 +623,12 @@ Returns:
|
||||
);
|
||||
} else {
|
||||
VerboseMsg ("Create Fv image and its map file");
|
||||
if (mFvDataInfo.BaseAddress != 0) {
|
||||
//
|
||||
// Will take rebase action at below situation:
|
||||
// 1. ForceRebase Flag specified to TRUE;
|
||||
// 2. ForceRebase Flag not specified, BaseAddress greater than zero.
|
||||
//
|
||||
if (((mFvDataInfo.BaseAddress > 0) && (mFvDataInfo.ForceRebase == -1)) || (mFvDataInfo.ForceRebase == 1)) {
|
||||
VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);
|
||||
}
|
||||
//
|
||||
|
@@ -209,6 +209,7 @@ Returns:
|
||||
DebugMsg (NULL, 0, 9, "rebase address", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);
|
||||
|
||||
FvInfo->BaseAddress = Value64;
|
||||
FvInfo->BaseAddressSet = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2826,11 +2827,20 @@ Returns:
|
||||
PeFileBuffer = NULL;
|
||||
|
||||
//
|
||||
// Don't need to relocate image when BaseAddress is not set.
|
||||
// Don't need to relocate image when BaseAddress is zero and no ForceRebase Flag specified.
|
||||
//
|
||||
if (FvInfo->BaseAddress == 0) {
|
||||
if ((FvInfo->BaseAddress == 0) && (FvInfo->ForceRebase == -1)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// If ForceRebase Flag specified to FALSE, will always not take rebase action.
|
||||
//
|
||||
if (FvInfo->ForceRebase == 0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
XipBase = FvInfo->BaseAddress + XipOffset;
|
||||
|
||||
//
|
||||
|
@@ -232,6 +232,7 @@ typedef struct {
|
||||
CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
|
||||
UINT32 SizeofFvFiles[MAX_NUMBER_OF_FILES_IN_FV];
|
||||
BOOLEAN IsPiFvImage;
|
||||
INT8 ForceRebase;
|
||||
} FV_INFO;
|
||||
|
||||
typedef struct {
|
||||
|
Reference in New Issue
Block a user