From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 98E6AD811A4 for ; Mon, 18 Mar 2024 09:08:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Ehzp5dfsaPflXBEhYAonGXMspu1cGRdMXr1yzTPey68=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1710752933; v=1; b=is+Uue4KbvGVbkICRXhE01h93TvPRX/cu+6zMVxe521F5sIsJC18LeZURF8OvlNDckBx5/fs LRUg88QW2G74aU4DD1xk08yFBRZlQf1EXZruoDTQeRMOthANx0DYyRaTff358Dlv5FJtzRu7JGN A53eQMZPM4B93dbYYBfgp+kQSIOz2v0bIKJvgLgwwnfFdtmWfL+ntfZ5whrKSACAqLMNGVRaLjk DryodECknhQ190+m2XoB+wFCg0cg5cTXxJ1cHY/AhFPRzu+jwh9WN1g0KLBqc3sT1X4L7EJUs9a 3tU2c4RZhJtIeWeSj2GCt6dXCLpgVz9Pqe/a+wBPxyw4g== X-Received: by 127.0.0.2 with SMTP id lpDRYY7687511x0kWoEFt7ir; Mon, 18 Mar 2024 02:08:53 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mx.groups.io with SMTP id smtpd.web10.38813.1710752932031965890 for ; Mon, 18 Mar 2024 02:08:52 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,11016"; a="5679389" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5679389" X-Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 02:08:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="36535993" X-Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.151]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 02:08:49 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Zhiguang Liu , Chasel Chiu , Nate DeSimone , Duggapu Chinni B , Star Zeng , Ted Kuo , Ashraf Ali S , Susovan Mohapatra Subject: [edk2-devel] [PATCH] IntelFsp2Pkg/Tools: Let PatchFv support to get Image Base. Date: Mon, 18 Mar 2024 17:08:35 +0800 Message-Id: <20240318090836.361-1-zhiguang.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 18 Mar 2024 02:08:52 -0700 Reply-To: devel@edk2.groups.io,zhiguang.liu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3ClxAF22IwQ53yaR6m91zOvwx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=is+Uue4K; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) Now, the value params of PatchFv support below value getting from map file: ModuleName:FunctionName ModuleName:GlobalVariableName ModuleGuid:Offset This patch add a new type ModuleName:KeyWord KeyWord now supports "BASE", indicating the address of the Image base. For example, ModuleName:BASE will be the address of the Image base. This will simplify the flow when user want to patch the Image base in the binary. In the future, we can let the KeyWord support more based on future usage. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Duggapu Chinni B Cc: Star Zeng Cc: Ted Kuo Cc: Ashraf Ali S Cc: Susovan Mohapatra Signed-off-by: Zhiguang Liu --- IntelFsp2Pkg/Tools/PatchFv.py | 1 + IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 73ab877c71..0cab73255d 100644 --- a/IntelFsp2Pkg/Tools/PatchFv.py +++ b/IntelFsp2Pkg/Tools/PatchFv.py @@ -384,6 +384,7 @@ class Symbols: if len(modName) == 36: modName = self.dictGuidNameXref[modName.upper()] self.dictModBase['%s:BASE' % modName] = int (match.group(2), 16) + self.dictSymbolAddress['%s:BASE' % modName] = match.group(2) self.dictModBase['%s:ENTRY' % modName] = int (match.group(3), 16) #(GUID=86D70125-BAA3-4296-A62F-602BEBBB9081 .textbaseaddress=0x00fffb4398 .databaseaddress=0x00fffb4178) match = re.match("\(GUID=([A-Z0-9\-]+)\s+\.textbaseaddress=(0x[0-9a-fA-F]+)\s+\.databaseaddress=(0x[0-9a-fA-F]+)\)", rptLine) diff --git a/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md b/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md index 205ad57773..b59e82c872 100644 --- a/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md +++ b/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md @@ -89,9 +89,10 @@ The entire argument includes the quote marks like in the example argument below: | 0x000000BC | 0xFFFFFFA2 | 188 | -94 | ``` -ModuleName:FunctionName | ModuleName:GlobalVariableName +ModuleName:FunctionName | ModuleName:GlobalVariableName | ModuleName:KeyWord ModuleGuid:Offset ``` +Note: KeyWord only supports "BASE" now, indicating the address of the PE Image base. ### Operators: -- 2.31.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116835): https://edk2.groups.io/g/devel/message/116835 Mute This Topic: https://groups.io/mt/104999188/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-