]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFv/GenFvInternalLib.c
BaseTools/GenFv: Account for rebase of FV section containing VTF file
[mirror_edk2.git] / BaseTools / Source / C / GenFv / GenFvInternalLib.c
index 7c839e277944db70007060c2c07315e2e6db53cd..123e3550dd97d027685ba33d3d6a2649b98509a4 100644 (file)
@@ -2770,11 +2770,13 @@ Returns:
       //\r
       // Update reset vector (SALE_ENTRY for IPF)\r
       // Now for IA32 and IA64 platform, the fv which has bsf file must have the \r
-      // EndAddress of 0xFFFFFFFF. Thus, only this type fv needs to update the   \r
-      // reset vector. If the PEI Core is found, the VTF file will probably get  \r
-      // corrupted by updating the entry point.                                  \r
+      // EndAddress of 0xFFFFFFFF (unless the section was rebased).
+      // Thus, only this type fv needs to update the  reset vector.
+      // If the PEI Core is found, the VTF file will probably get
+      // corrupted by updating the entry point.
       //\r
-      if ((mFvDataInfo.BaseAddress + mFvDataInfo.Size) == FV_IMAGES_TOP_ADDRESS) {       \r
+      if (mFvDataInfo.ForceRebase == 1 ||
+          (mFvDataInfo.BaseAddress + mFvDataInfo.Size) == FV_IMAGES_TOP_ADDRESS) {
         Status = UpdateResetVector (&FvImageMemoryFile, &mFvDataInfo, VtfFileImage);\r
         if (EFI_ERROR(Status)) {                                               \r
           Error (NULL, 0, 3000, "Invalid", "Could not update the reset vector.");\r