summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Ni <ray.ni@intel.com>2021-06-29 11:07:51 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-06-30 07:12:54 +0000
commit3cde0d553d9324a3681b65f9d9a2a8691af26840 (patch)
treee68c5a8e316807e709eea2fd0250945c7f1ba7f9
parent939ed3a59223f516e5168577ba61ee3baf98eeea (diff)
downloadedk2-3cde0d553d9324a3681b65f9d9a2a8691af26840.tar.gz
edk2-3cde0d553d9324a3681b65f9d9a2a8691af26840.tar.bz2
edk2-3cde0d553d9324a3681b65f9d9a2a8691af26840.zip
UefiPayloadPkg/PayloadLoader: Remove assertion
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.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
-rw-r--r--UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c1
-rw-r--r--UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c1
2 files changed, 0 insertions, 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 {
//