]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiPayloadPkg/PayloadLoader: Remove assertion
authorRay Ni <ray.ni@intel.com>
Tue, 29 Jun 2021 03:07:51 +0000 (11:07 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 30 Jun 2021 07:12:54 +0000 (07:12 +0000)
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>
UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c

index dd27d3ce5938049bba8fa6c50c4cbc8e06217bd3..780f2d95074287961f69f49d62d2402b50d0cf70 100644 (file)
@@ -164,7 +164,6 @@ ProcessRelocation32 (
           // Calculation: B + A\r
           //\r
           if (RelaType == SHT_RELA) {\r
-            ASSERT (*Ptr == 0);\r
             *Ptr = (UINT32) Delta + Rela->r_addend;\r
           } else {\r
             //\r
index 3f4f12903cec39c1e4e0e261b302deea5b9ade35..0f1b06e8ccbbe329a089f6b17d34c9f565070c52 100644 (file)
@@ -173,7 +173,6 @@ ProcessRelocation64 (
           // Calculation: B + A\r
           //\r
           if (RelaType == SHT_RELA) {\r
-            ASSERT (*Ptr == 0);\r
             *Ptr = Delta + Rela->r_addend;\r
           } else {\r
             //\r