For R_386_RELATIVE and R_X86_64_RELATIVE, today's logic assumes that the content pointed by the Rela->r_offset is 0 but it's not always TRUE. We observed that linker may set the content to Rela->r_addend.
The patch removes the assertion. There is no functionality impact for this patch. Signed-off-by: Ray Ni <ray...@intel.com> Cc: Maurice Ma <maurice...@intel.com> Cc: Guo Dong <guo.d...@intel.com> Cc: Benjamin You <benjamin....@intel.com> --- UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c | 1 - UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c | 1 - 2 files changed, 2 deletions(-) diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c index dd27d3ce59..780f2d9507 100644 --- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c +++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c @@ -164,7 +164,6 @@ ProcessRelocation32 ( // Calculation: B + A // if (RelaType == SHT_RELA) { - ASSERT (*Ptr == 0); *Ptr = (UINT32) Delta + Rela->r_addend; } else { // diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c index 3f4f12903c..0f1b06e8cc 100644 --- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c +++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c @@ -173,7 +173,6 @@ ProcessRelocation64 ( // Calculation: B + A // if (RelaType == SHT_RELA) { - ASSERT (*Ptr == 0); *Ptr = Delta + Rela->r_addend; } else { // -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77249): https://edk2.groups.io/g/devel/message/77249 Mute This Topic: https://groups.io/mt/83863242/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-