From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.163.191.146; helo=sonic304-20.consmr.mail.ne1.yahoo.com; envelope-from=zenith432@users.sourceforge.net; receiver=edk2-devel@lists.01.org Received: from sonic304-20.consmr.mail.ne1.yahoo.com (sonic304-20.consmr.mail.ne1.yahoo.com [66.163.191.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 A1A42202E53F3 for ; Mon, 9 Jul 2018 02:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1531129013; bh=PTrM79lJcGfYd05vqVshS+5RhoaGHxcJPFE0Sf5rIG0=; h=Date:From:Reply-To:To:Cc:Subject:References:From:Subject; b=XkZRByiNTpRoT2de6TR07LQTEZcXwU+yMoknzByxDVQKzt/shWznPLesjssjn+U5SHBgWSjNtaUX9dvNnXCZJ7a2AleW5WAcnGdfCj1hJwNrIT6OxQMicHL0iLhSMw26HYX8AycuY2N0qcCxISKxAUq3YmRY3hAJopCwcDHTpeoxJkVppqstycGEgc9Da+FYr6lzAe0vl7ErzL6umDLDlAdXwlq0d44zbWgvpkzvyD7gJoZE9ROv9eZ0LyMTRJuubmZdEfUl5UuNpFbHiSpr+SkuElM3cnYJade1jMLIx5ByNyDWgIjxBpX1+JXchzKRdF2jT+YB5g2jCH/1AeXaSg== X-YMail-OSG: aeWvHt8VM1kKe4d.u_bXYOogDmjYPWMP7N0dU0T3JJG5nkqoE82bWeHjD6Je_rr vv5ERlVD5RM9opbggpcVWqvlwgrRJ5ml5izG2UVqC_hkkkqg7OLRZ_FKpJ_Jmfd6v2az.8HQnmhL pQ5f5G0H21FYRt8I4vPb_9Wf5zo2V71zWclFxhp8T5jMykIb3.2kIVQF7RQB_aYwGnP4Hwj4Or78 p5XaFPl342Yv_QbcB7eSxirPmw6El1GybMLptx4bB73CKlak0Ysfs7_RdVAYVRx5oFpJTXf8k6dD 6kjVkRRZ5XfmogLfxL1f1W9UWp.hCNrbhUYvSXUZPPTZ6hj5L9Nf_WOo4xdglylSGVb242cxclyJ W7_b.HNFAEGU2hv2hXlaSDilKJE.gPalQIToMUvbxBfYfhqRPoqXl4ZV5zablcVcyqdZTCI9K6k2 X.kpac7xWB6mCcKP5.WTne4LVkf__NO_4_jhbTKGToUGZVETTuBqR.oH.44QFAGzFIDhLCZETDNp ATRep4utDYtEZx1KvarsTjA_ZmnnpPnXdpOT4X7kjEXrr5ZxsyIcW3Izg_uP2tBSDzBz2yCPGp17 A7H33vXPXaprkb6agdh.ErKwb4oxGkJGNu0IjcnZf0YVXCfWEtPQnx88xsCqqLzbfwpEbuG5k2xQ ddxrywYPk3TK5Txc4E.ja850S9bRK7Z0wMytXsEIDqqRTvkZ2I8vuf2NVzq4ABvDVO8Krv3iafAl 4MXl4vmoTIiX3o0rPGyOTBQT9pVhLcj43pMInYj7W.edICgUCjgxlvcuYnB0wXo8UMkBnpz97HyT 4f0FlNoHQiWLxT36TtzEdlTZqQNyHjREPZZ8lrBAhlLr5veQcB2rsRw5SGFujiWAQN8DsJyWdLsD p22w4VXKOjif8B5benWQ5Iqin2zKFR944GmdjpWz3CXWXmTxIyKg9d0UK10cg0.KD_7CEr28_xgb XYsQqMZ20Uz6CPsf9VovVR2a.nRQZnPPJYPvS6gbHaoS3iMbQ4UY- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Mon, 9 Jul 2018 09:36:53 +0000 Date: Mon, 9 Jul 2018 09:36:51 +0000 (UTC) From: Zenith432 Reply-To: Zenith432 To: Cc: Message-ID: <1903143001.1215482.1531129011285@mail.yahoo.com> MIME-Version: 1.0 References: <1903143001.1215482.1531129011285.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: [PATCH] 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: , X-List-Received-Date: Mon, 09 Jul 2018 09:36:55 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit REF:https://bugzilla.tianocore.org/show_bug.cgi?id=999 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zenith432 --- BaseTools/Source/C/GenFw/Elf64Convert.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index 4636cfee..a4feaf7c 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -993,7 +993,30 @@ WriteRelocations64 ( + (Rel->r_offset - SecShdr->sh_addr)), EFI_IMAGE_REL_BASED_DIR64); break; +#if 0 + // + // R_X86_64_32 and R_X86_64_32S are ELF64 relocations emitted when using + // the SYSV X64 ABI small non-position-independent code model. + // 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-relative 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_ADDRESS_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-extended 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 page-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 disabled. + // case R_X86_64_32S: +#endif case R_X86_64_32: VerboseMsg ("EFI_IMAGE_REL_BASED_HIGHLOW Offset: 0x%08X", mCoffSectionsOffset[RelShdr->sh_info] + (Rel->r_offset - SecShdr->sh_addr)); -- 2.17.1