From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web09.24990.1657515937122848097 for ; Sun, 10 Jul 2022 22:05:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NFfhtFxz; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: james.lu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657515937; x=1689051937; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=z/hyzJmqb8mS4ylSqHdjqyHa5M2ejWAmntrKeRj/Pj4=; b=NFfhtFxz5HjpOE+Gf1UoSYK3hEXggX1ugmrh5zUCFIi3o1WHU2tMEXXZ N6n+PLg77VnQwGbx1qlLefoR8WK5enmUjXj82wZj2t7nSCCytDdFDbhEH yGTA/jl3WjBGF4wosmjj5QzmrzCqvJ2JDDT8SOOqTrEwLm4lNXJRiiEpo 1HsFDaO/FfUF0ZxH8GN0KcA4j2qNmUGhJavv3jo8DscscnZ4Xfved1hu9 BuvMqSiFW6vBgHxE3t0f5AYFyaH9sdyLgJTvXpdmuGIo13F8mFDHoSqdR UMIO1LAxd/qWTvL7UpMMpfStmgk3ol6WRVfbWfXdONQRiP4tlFwyHsiLM w==; X-IronPort-AV: E=McAfee;i="6400,9594,10404"; a="283330474" X-IronPort-AV: E=Sophos;i="5.92,262,1650956400"; d="scan'208";a="283330474" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 22:05:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,262,1650956400"; d="scan'208";a="771396959" Received: from jameslu8-desk2.gar.corp.intel.com ([10.5.215.168]) by orsmga005.jf.intel.com with ESMTP; 10 Jul 2022 22:05:34 -0700 From: "Lu, James" To: devel@edk2.groups.io Cc: James Lu , Ray Ni , Guo Dong , Gua Guo Subject: [PATCH] UefiPayloadPkg: Fix RelaAddress type always mismatch in if condition Date: Mon, 11 Jul 2022 13:05:31 +0800 Message-Id: <6749516ae40598938d4a7447d5d607aa6ad52756.1657515840.git.james.lu@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: James Lu REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3984 Under function RolocateElfDynamic() in Elf32Lib.c if (RelaAddress =3D=3D MAX_UINT64) is always FALSE while RelaAddress is UIN= T32 Fix is to modify if condition check to "if (RelaAddress =3D=3D MAX_UINT32)" Cc: Ray Ni Cc: Guo Dong Cc: Gua Guo Signed-off-by: James Lu --- UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c b/UefiPaylo= adPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c index b002c4b9cf..cb915e7142 100644 --- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c +++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c @@ -292,7 +292,7 @@ RelocateElf32Dynamic ( }=0D }=0D =0D - if (RelaAddress =3D=3D MAX_UINT64) {=0D + if (RelaAddress =3D=3D MAX_UINT32) {=0D ASSERT (RelaCount =3D=3D 0);=0D ASSERT (RelaEntrySize =3D=3D 0);=0D ASSERT (RelaSize =3D=3D 0);=0D --=20 2.26.2.windows.1