1 From 5552b8d1c885b1215cec72b8e21b5816a4511737 Mon Sep 17 00:00:00 2001
2 From: Olivier Martin <olivier.martin@arm.com>
3 Date: Wed, 8 Jun 2011 19:30:49 +0100
4 Subject: [PATCH] Fix GenFv for FV files located at 0x0
6 Fix GenFv for FV file rebased at 0x0 by using the more appropriate attribute 'BaseAddressSet' already defined in the FV_INFO structure.
8 BaseTools/Source/C/GenFv/GenFv.c | 2 +-
9 BaseTools/Source/C/GenFv/GenFvInternalLib.c | 3 ++-
10 2 files changed, 3 insertions(+), 2 deletions(-)
11 mode change 100644 => 100755 BaseTools/Source/C/GenFv/GenFv.c
13 diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c
16 index 2cb8771..4662461
17 --- a/BaseTools/Source/C/GenFv/GenFv.c
18 +++ b/BaseTools/Source/C/GenFv/GenFv.c
19 @@ -598,7 +598,7 @@ Returns:
22 VerboseMsg ("Create Fv image and its map file");
23 - if (mFvDataInfo.BaseAddress != 0) {
24 + if (mFvDataInfo.BaseAddressSet) {
25 VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);
28 diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
29 index 189dc43..985e4d8 100644
30 --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
31 +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
32 @@ -209,6 +209,7 @@ Returns:
33 DebugMsg (NULL, 0, 9, "rebase address", "%s = %s", EFI_FV_BASE_ADDRESS_STRING, Value);
35 FvInfo->BaseAddress = Value64;
36 + FvInfo->BaseAddressSet = TRUE;
40 @@ -2820,7 +2821,7 @@ Returns:
42 // Don't need to relocate image when BaseAddress is not set.
44 - if (FvInfo->BaseAddress == 0) {
45 + if (FvInfo->BaseAddressSet == FALSE) {
48 XipBase = FvInfo->BaseAddress + XipOffset;