Add more description for it: GCC49 has enhance the global variable name conflict check. If different module share the same global name, it will report link error. This patch fixed one case reported for DxeTpmMeasureBootLib and DxeImageVerificationLib.
-----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Eric Dong Sent: Thursday, December 17, 2015 3:55 PM To: [email protected]; Gao, Liming Subject: [edk2] [Patch] DxeTpmMeasureBootLib: Change global variable name to avoid name conflict. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <[email protected]> --- .../Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c index cd48a1a..25788b8 100644 --- a/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c +++ b/SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c @@ -51,11 +51,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Flag to check GPT partition. It only need be measured once. // BOOLEAN mMeasureGptTableFlag = FALSE; UINTN mMeasureGptCount = 0; VOID *mFileBuffer; -UINTN mImageSize; +UINTN mTpmImageSize; // // Measured FV handle cache // EFI_HANDLE mCacheMeasuredHandle = NULL; MEASURED_HOB_DATA *mMeasuredHobData = NULL; @@ -93,15 +93,15 @@ DxeTpmMeasureBootLibImageRead ( if (MAX_ADDRESS - FileOffset < *ReadSize) { return EFI_INVALID_PARAMETER; } EndPosition = FileOffset + *ReadSize; - if (EndPosition > mImageSize) { - *ReadSize = (UINT32)(mImageSize - FileOffset); + if (EndPosition > mTpmImageSize) { + *ReadSize = (UINT32)(mTpmImageSize - FileOffset); } - if (FileOffset >= mImageSize) { + if (FileOffset >= mTpmImageSize) { *ReadSize = 0; } CopyMem (Buffer, (UINT8 *)((UINTN) FileHandle + FileOffset), *ReadSize); @@ -906,11 +906,11 @@ DxeTpmMeasureBootHandler ( if (FileBuffer == NULL) { Status = EFI_SECURITY_VIOLATION; goto Finish; } - mImageSize = FileSize; + mTpmImageSize = FileSize; mFileBuffer = FileBuffer; // // Measure PE Image // -- 2.6.4.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

