diff --git a/BaseTools/ImageTool/UeEmit.c b/BaseTools/ImageTool/UeEmit.c index 321dfa909f..9fd42a737c 100644 --- a/BaseTools/ImageTool/UeEmit.c +++ b/BaseTools/ImageTool/UeEmit.c @@ -598,7 +598,7 @@ ToolImageEmitUeDebugTable ( ) { UE_DEBUG_TABLE DebugTable; - uint8_t SymOffsetFactor; + uint8_t SymSubtrahendFactor; uint32_t DebugTableOffset; uint32_t DebugTableSize; uint16_t Index; @@ -609,14 +609,14 @@ ToolImageEmitUeDebugTable ( assert (Image->DebugInfo.SymbolsPathLen <= MAX_UINT8); assert (IS_ALIGNED (BaseAddressSubtrahend, Image->SegmentInfo.SegmentAlignment)); - SymOffsetFactor = (uint8_t)(BaseAddressSubtrahend / Image->SegmentInfo.SegmentAlignment); - if (SymOffsetFactor > 0x03) { + SymSubtrahendFactor = (uint8_t)(BaseAddressSubtrahend / Image->SegmentInfo.SegmentAlignment); + if (SymSubtrahendFactor > 0x03) { DEBUG_RAISE (); return false; } - DebugTable.ImageInfo = SymOffsetFactor; - assert (UE_DEBUG_TABLE_IMAGE_INFO_SYM_OFFSET_FACTOR (DebugTable.ImageInfo) == SymOffsetFactor); + DebugTable.ImageInfo = SymSubtrahendFactor; + assert (UE_DEBUG_TABLE_IMAGE_INFO_SYM_SUBTRAHEND_FACTOR (DebugTable.ImageInfo) == SymSubtrahendFactor); assert ((DebugTable.ImageInfo & 0xFCU) == 0); DebugTable.SymbolsPathLength = (uint8_t)Image->DebugInfo.SymbolsPathLen; diff --git a/MdePkg/Include/IndustryStandard/UeImage.h b/MdePkg/Include/IndustryStandard/UeImage.h index 3e88d972cc..6f1a188bc5 100644 --- a/MdePkg/Include/IndustryStandard/UeImage.h +++ b/MdePkg/Include/IndustryStandard/UeImage.h @@ -407,11 +407,11 @@ typedef struct { (OFFSET_OF (UE_DEBUG_TABLE, SymbolsPath) + 1U) /** - Retrieves the UE symbols address offset in SegmentAlignment-units. + Retrieves the UE symbol address subtrahend in SegmentAlignment-units. @param[in] ImageInfo The UE debug table image information. **/ -#define UE_DEBUG_TABLE_IMAGE_INFO_SYM_OFFSET_FACTOR(ImageInfo) \ +#define UE_DEBUG_TABLE_IMAGE_INFO_SYM_SUBTRAHEND_FACTOR(ImageInfo) \ ((UINT8)((ImageInfo) & 0x03U)) /** diff --git a/MdePkg/Library/BaseUeImageLib/UeImageLib.c b/MdePkg/Library/BaseUeImageLib/UeImageLib.c index 5f2819d743..f5f6e8720b 100644 --- a/MdePkg/Library/BaseUeImageLib/UeImageLib.c +++ b/MdePkg/Library/BaseUeImageLib/UeImageLib.c @@ -1231,21 +1231,21 @@ UeLoaderGetImageDebugAddress ( RETURN_STATUS Status; CONST UE_DEBUG_TABLE *DebugTable; UINT8 SymOffsetFactor; - UINT32 SymOffsetAddend; + UINT32 SymOffsetSubtrahend; ASSERT (Context != NULL); - SymOffsetAddend = 0; + SymOffsetSubtrahend = 0; Status = InternalGetDebugTable (Context, &DebugTable); if (!RETURN_ERROR (Status)) { - SymOffsetFactor = UE_DEBUG_TABLE_IMAGE_INFO_SYM_OFFSET_FACTOR ( + SymOffsetFactor = UE_DEBUG_TABLE_IMAGE_INFO_SYM_SUBTRAHEND_FACTOR ( DebugTable->ImageInfo ); - SymOffsetAddend = (UINT32)SymOffsetFactor * Context->SegmentAlignment; + SymOffsetSubtrahend = (UINT32)SymOffsetFactor * Context->SegmentAlignment; } - return UeLoaderGetImageAddress (Context) + SymOffsetAddend; + return UeLoaderGetImageAddress (Context) - SymOffsetSubtrahend; } RETURN_STATUS