From 9053bc517ea77b9780830bf08b966979eff1cb0f Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 28 Jun 2010 09:33:10 +0000 Subject: Sync EDKII BaseTools to BaseTools project r1988 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10607 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/C/Common/BasePeCoff.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'BaseTools/Source/C/Common') diff --git a/BaseTools/Source/C/Common/BasePeCoff.c b/BaseTools/Source/C/Common/BasePeCoff.c index 878c1c611b..4a3f92fb15 100644 --- a/BaseTools/Source/C/Common/BasePeCoff.c +++ b/BaseTools/Source/C/Common/BasePeCoff.c @@ -2,7 +2,7 @@ Functions to get info and load PE/COFF image. -Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -629,15 +629,10 @@ Returns: } // - // If the destination address is not 0, use that rather than the - // image address as the relocation target. + // Use DestinationAddress field of ImageContext as the relocation address even if it is 0. // - if (ImageContext->DestinationAddress) { - BaseAddress = ImageContext->DestinationAddress; - } else { - BaseAddress = ImageContext->ImageAddress; - } - + BaseAddress = ImageContext->DestinationAddress; + if (!(ImageContext->IsTeImage)) { PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)((UINTN)ImageContext->ImageAddress + ImageContext->PeCoffHeaderOffset); -- cgit v1.2.3