From nobody Wed May 1 00:03:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=quarantine dis=none) header.from=users.sourceforge.net Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 153121264254356.307422691780744; Tue, 10 Jul 2018 01:50:42 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 329942096F344; Tue, 10 Jul 2018 01:50:42 -0700 (PDT) Received: from sonic305-20.consmr.mail.ne1.yahoo.com (sonic305-20.consmr.mail.ne1.yahoo.com [66.163.185.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0596B20337350 for ; Tue, 10 Jul 2018 01:50:40 -0700 (PDT) Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Tue, 10 Jul 2018 08:50:39 +0000 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.163.185.146; helo=sonic305-20.consmr.mail.ne1.yahoo.com; envelope-from=zenith432@users.sourceforge.net; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1531212639; bh=c5MDAA/HfpeoLdLsDy4cC4Ct4Dk3aPxcKNtZaZMtBH0=; h=Date:From:Reply-To:To:Cc:Subject:References:From:Subject; b=h3nAe9f2zn1crRvoH512FyBKPnXAYIgpBdqlxr7gVovtw8EqZgYyOZs+87yUePyt8r99lPx79SJ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ntde1ZqCjCjJ635olGMnNKL W9sNM0mwI35dmTwS30IkdTIZTrgMBA1JgHwYr4fqcGWdOpkmUkRdrXFp_kmb0qqcfEoT5ClV3KcB mQ4ntjqFX_ewfpwsPvW3048xbUgDn84vjF4lrVAPucoSb8cXZMk0XEfRItkQo.KoubadCn86DWAd 9Wxe_HYTO5KSknN6I..9ETVcgd_ZCvQIiChR.PGfHsM1CRfAT3KbH0jzaiso- Date: Tue, 10 Jul 2018 08:50:36 +0000 (UTC) From: Zenith432 To: "edk2-devel@lists.01.org" Message-ID: <1951991717.1897081.1531212636728@mail.yahoo.com> MIME-Version: 1.0 References: <1951991717.1897081.1531212636728.ref@mail.yahoo.com> X-Mailer: WebService/1.1.12062 YahooMailBasic Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0 Subject: [edk2] [PATCH v2] BaseTools/GenFw: Disable support for R_X86_64_32S X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Zenith432 Cc: LimingGao Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D999 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zenith432 Reviewed-by: Liming Gao --- BaseTools/Source/C/GenFw/Elf64Convert.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/G= enFw/Elf64Convert.c index 4636cfee..e42cc3f7 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -993,7 +993,28 @@ WriteRelocations64 ( + (Rel->r_offset - SecShdr->sh_addr)), EFI_IMAGE_REL_BASED_DIR64); break; - case R_X86_64_32S: + // + // R_X86_64_32 and R_X86_64_32S are ELF64 relocations emitted = when using + // the SYSV X64 ABI small non-position-independent code mode= l. + // R_X86_64_32 is used for unsigned 32-bit immediates with a= 32-bit operand + // size. The value is either not extended, or zero-extended= to 64 bits. + // R_X86_64_32S is used for either signed 32-bit non-rip-rel= ative displacements + // or signed 32-bit immediates with a 64-bit operand size. = The value is + // sign-extended to 64 bits. + // EFI_IMAGE_REL_BASED_HIGHLOW is a PE relocation that uses = 32-bit arithmetic + // for rebasing an image. + // EFI PE binaries declare themselves EFI_IMAGE_FILE_LARGE_A= DDRESS_AWARE and + // may load above 2GB. If an EFI PE binary with a converted= R_X86_64_32S + // relocation is loaded above 2GB, the value will get sign-e= xtended to the + // negative part of the 64-bit address space. The negative = part of the 64-bit + // address space is unmapped, so accessing such an address p= age-faults. + // In order to support R_X86_64_32S, it is necessary to unset + // EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE, and the EFI PE loader= must implement + // this flag and abstain from loading such a PE binary above= 2GB. + // Since this feature is not supported, support for R_X86_64= _32S (and hence + // the small non-position-independent code model) is disable= d. + // + // case R_X86_64_32S: case R_X86_64_32: VerboseMsg ("EFI_IMAGE_REL_BASED_HIGHLOW Offset: 0x%08X", mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - S= ecShdr->sh_addr)); --=20 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel