summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Documentation/patches/BaseTools-GenFv-Fix-0x0-Based-FV.patch
blob: b2029f21e445177b5f85138d953618f44d43aa78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 5552b8d1c885b1215cec72b8e21b5816a4511737 Mon Sep 17 00:00:00 2001
From: Olivier Martin <olivier.martin@arm.com>
Date: Wed, 8 Jun 2011 19:30:49 +0100
Subject: [PATCH] Fix GenFv for FV files located at 0x0

Fix GenFv for FV file rebased at 0x0 by using the more appropriate attribute 'BaseAddressSet' already defined in the FV_INFO structure.
---
 BaseTools/Source/C/GenFv/GenFv.c            |    2 +-
 BaseTools/Source/C/GenFv/GenFvInternalLib.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 BaseTools/Source/C/GenFv/GenFv.c

diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c
old mode 100644
new mode 100755
index 2cb8771..4662461
--- a/BaseTools/Source/C/GenFv/GenFv.c
+++ b/BaseTools/Source/C/GenFv/GenFv.c
@@ -598,7 +598,7 @@ Returns:
               );
   } else {
     VerboseMsg ("Create Fv image and its map file");
-    if (mFvDataInfo.BaseAddress != 0) {
+    if (mFvDataInfo.BaseAddressSet) {
       VerboseMsg ("FvImage Rebase Address is 0x%llX", (unsigned long long) mFvDataInfo.BaseAddress);
     }
     //
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index 189dc43..985e4d8 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -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;
     }
   }
 
@@ -2820,7 +2821,7 @@ Returns:
   //
   // Don't need to relocate image when BaseAddress is not set.
   //
-  if (FvInfo->BaseAddress == 0) {
+  if (FvInfo->BaseAddressSet == FALSE) {
     return EFI_SUCCESS;
   }
   XipBase = FvInfo->BaseAddress + XipOffset;
-- 
1.6.3.3