From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.5760.1685504915983820065 for ; Tue, 30 May 2023 20:48:36 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=OwfDHoyU; spf=none, err=permanent DNS error (domain: linux.intel.com, ip: 134.134.136.65, mailfrom: jiaqing.zhao@linux.intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685504915; x=1717040915; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2/Y7JL8HkjXBi7Ycjz8IiGuI03C4YWKlbiTUKtHbFBY=; b=OwfDHoyUdP+LiyTc6NEis8KRCEIY2Yx4Rl5uSB2eSdTB5LNmxGhkxEev G8oXeI9xPNi/m5ZQlSev8N2cTzmkvu31HEUxkL+Y3cBfy7VoU79w52PGC rAJ67Hq8XQmSiNB5DPFLXUQXR8o8oKod9AfWysmW0LaUqSOx7wE+bIeMC CgqLL9u+TYPWdWYunRORMe0xGdInJ8RVc6ZTW147Oc1wPXpOUtBLyOJk8 ZJIYmOV7kg03UqcqAVGqv6XAHhZwmOYNj1PqvoG/bip/qoA8rPl7BWZtk WXrdd3GVKsOWjDEPAPWfJrzozrysSFXuJRau6TLY05P6NdN+Dbhb3c9kI g==; X-IronPort-AV: E=McAfee;i="6600,9927,10726"; a="358387626" X-IronPort-AV: E=Sophos;i="6.00,205,1681196400"; d="scan'208";a="358387626" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2023 20:48:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10726"; a="953450630" X-IronPort-AV: E=Sophos;i="6.00,205,1681196400"; d="scan'208";a="953450630" Received: from unknown (HELO jiaqingz-acrn-container.sh.intel.com) ([10.239.138.235]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2023 20:48:33 -0700 From: Jiaqing Zhao To: devel@edk2.groups.io Cc: Jiaqing Zhao Subject: [PATCH] IntelFsp2Pkg/Tools: PatchFv: Handle 32-bit address in GCC map Date: Wed, 31 May 2023 03:48:27 +0000 Message-Id: <20230531034827.93847-1-jiaqing.zhao@linux.intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Some versions of ld (like 2.40 in Ubuntu 23.04) uses 32-bit address when generating map files for IA32 build. This patch enables PatchFv.py to parse these 32-bit addresses in GCC map properly. Signed-off-by: Jiaqing Zhao --- IntelFsp2Pkg/Tools/PatchFv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 73ab877c71..2e60343180 100644 --- a/IntelFsp2Pkg/Tools/PatchFv.py +++ b/IntelFsp2Pkg/Tools/PatchFv.py @@ -432,7 +432,8 @@ class Symbols: if reportLine.strip().find("Archive member included") !=3D -1:=0D #GCC=0D # 0x0000000000001d55 IoRead8=0D - patchMapFileMatchString =3D "\s+(0x[0-9a-fA-F]{16})\s+([^\s][^= 0x][_a-zA-Z0-9\-]+)\s"=0D + # 0x00001d55 IoRead8=0D + patchMapFileMatchString =3D "\s+(0x[0-9a-fA-F]{8,16})\s+([^\s]= [^0x][_a-zA-Z0-9\-]+)\s"=0D matchKeyGroupIndex =3D 2=0D matchSymbolGroupIndex =3D 1=0D prefix =3D '_'=0D @@ -458,7 +459,7 @@ class Symbols: if handleNext:=0D handleNext =3D False=0D pcdName =3D match.group(1)=0D - match =3D re.match("\s+(0x[0-9a-fA-F]{16})\s+", repo= rtLine)=0D + match =3D re.match("\s+(0x[0-9a-fA-F]{8,16})\s+", re= portLine)=0D if match is not None:=0D modSymbols[prefix + pcdName] =3D match.group(1)=0D else:=0D --=20 2.39.2