]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameter
authorGuomin Jiang <guomin.jiang@intel.com>
Sat, 29 Jan 2022 08:28:02 +0000 (16:28 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 1 Mar 2022 02:45:28 +0000 (02:45 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818

It will have some potential issue when memory larger than 2G because
the high memory address will be fill with 0xFFFFFFFF when do the
operation of INTN + INT64 but it is 32 bit normal data in fact.

Should use same data type INT64 + INT64.

V3:
1. Use INT64 as input parameter because all date type is 64 bit
V2:
1. Force the data type to UINTN to avoid high dword be filled with
0xFFFFFFFF
2. Keep INTN because the offset may postive or negative.

Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf64Lib.c

index dc47a05c6e4aa17f722943f8b9861ed44eea124c..c8dbb887340b556193edd2600cfc27f5bee1c400 100644 (file)
@@ -108,7 +108,7 @@ ProcessRelocation64 (
   IN  UINT64      RelaSize,\r
   IN  UINT64      RelaEntrySize,\r
   IN  UINT64      RelaType,\r
-  IN  INT       Delta,\r
+  IN  INT64       Delta,\r
   IN  BOOLEAN     DynamicLinking\r
   )\r
 {\r