From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 31BF51A1E4F for ; Wed, 12 Oct 2016 18:03:24 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 12 Oct 2016 18:03:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,338,1473145200"; d="scan'208";a="1043951029" Received: from mxma-desk2.amr.corp.intel.com ([134.134.155.154]) by orsmga001.jf.intel.com with ESMTP; 12 Oct 2016 18:03:23 -0700 From: Maurice Ma To: edk2-devel@lists.01.org Cc: Maurice Ma , Jiewen Yao , Giri P Mudusuru Date: Wed, 12 Oct 2016 18:03:17 -0700 Message-Id: <7ea97596e527f44a8d69170d0481c21ff087c565.1476320550.git.maurice.ma@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [PATCH] IntelFsp2Pkg/FspSecCore: Make FSP funcitons position independent X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 01:03:24 -0000 The current AsmGetFspInfoHeader function in FspHeader.nasm is position dependent code since it uses absolute address. Change to use relative address instead to make it position independent. Cc: Jiewen Yao Cc: Giri P Mudusuru Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Maurice Ma --- IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm index a848dcbc0298..ad631943e32d 100644 --- a/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm +++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm @@ -31,7 +31,7 @@ ASM_PFX(NextInstruction): pop eax sub eax, ASM_PFX(NextInstruction) add eax, ASM_PFX(AsmGetFspInfoHeader) - sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] + sub eax, dword [eax - ASM_PFX(AsmGetFspInfoHeader) + ASM_PFX(FspInfoHeaderRelativeOff)] ret global ASM_PFX(AsmGetFspInfoHeaderNoStack) -- 1.9.5.msysgit.0