From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.163.185.147; helo=sonic305-21.consmr.mail.ne1.yahoo.com; envelope-from=zenith432@users.sourceforge.net; receiver=edk2-devel@lists.01.org Received: from sonic305-21.consmr.mail.ne1.yahoo.com (sonic305-21.consmr.mail.ne1.yahoo.com [66.163.185.147]) (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 195A6209831FA for ; Thu, 7 Jun 2018 05:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1528375564; bh=GoNRRo22yVh1KHlxvx6FbcHwC+2rpD50MwcOvBmA4mc=; h=Date:From:Reply-To:To:Cc:Subject:References:From:Subject; b=WeFHIQ9MxcOE04fn1D58ReXQVm/Tas8GSSuWlWhDKdzUsvpNLbyMcHlK4NwTfPxEAPfTOUYyU9+P7EHWYIvZG8/k83i1QRrxmnhUbHhIfwUa5oXS0L0se8UOnF1sbI8bfhGaq2lJcBqiAsYkeHGtXl0Cl35J4gw+rbpCARlwJ+xXAGHvXKxJtG1VJhQCJ3kXnqE0GD5vSyE3TvYD00SggFL79/5MZOfBEzLOxcnUiY6bpixyycLilhvqXCKegrVPlkLZGDNLwD4xD9jWJKuAYV/6+h792XtAbcxBf74fWw/l3ATiTPS0pVYsRYKZ3c0yDMuOEWdL8fmshFWYc3nNug== X-YMail-OSG: T8bSZT8VM1mpyM.rpKDwAsHRVcTxasJsecNkYvtm2RYuPFktALnUQh7swIj2Vg0 lbxeCNZzB_TsTyiJBgAra.HXZjeFDt6iz.5Uo0XRb06PrjvCULwPFrn3aaBzl7wBn3_iVINgy91F PAThbXNKQThgdOB75dVvkZt9QNGqF_dJJMC3Euq39VKNZJYxr3SFMF_tnDEAy98R1Husk4OjvgpV vLT8LKOnfblSfUerhaXtwT8hj4pmcTA8V26HCoYhg.o2JpPe77ex9I3RHZOqip3LcJ6nJIydjWT5 G2QoHGwfTFz.U4x50lcwtrd1JYmXhZ1FZvxseAfNiemcV.wr_6QZOTVCD5FXolfNFLE8Bbw9qPJg U7UGvE8oob4QaqECjF_EVDTM4Zs1DsJgZWlWBioQoT04Xl60TB.Ryj5yMGCDu2.z4siXzUBWxzNM bwYIkC6eBeIH3FA5GTpSFJQKb4YD_k.ZI3vTyXLsKotIJDhvsBPU.i2pWJVsdz1m0a0N_8z5x9Fo j3MHyOI2wylNiN_N1lCufYyDelnFtKgSl70tUwMR75gh3N6bxyOItCNylvNoQOQjvgKDLHVmo96K yRs4uYAQj7WTKXVU9J7eGTHMu1ajMArBAJmUb1Yk16falBFrsS.1rIkSHol3jAG5kg_Dw4RYWc1d KK4on8_G5D3yE4YVIXNjOPtduAapojgE5XeMF9f5VOp2uFTlFR2EzXEgVkEbdwjN6JZpp70xGHbc qiEXDzZvIeku8sEQZLR5GZjqQ4s6GG8655QkaqWH.IRGvcqX7J5YGKQg01bhUjyZ9MCDr637BfKM FHi7vBg7nvRe5yHIfMOO5TungKDHFPwrv7D15ozQ_oriUjgP0zXNa9HzPA1MgoClb9gXL.Gbw_C7 EU.fYSJqRx6azLLt3CkLVUK1hFw62wKIMrJA6_.itoUjb62h9jifnK7suU.d9zy98SBPKcw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Thu, 7 Jun 2018 12:46:04 +0000 Date: Thu, 7 Jun 2018 12:46:03 +0000 (UTC) From: Zenith432 Reply-To: Zenith432 To: LimingGao Cc: "edk2-devel@lists.01.org" , StevenShi Message-ID: <443019651.1678894.1528375563310@mail.yahoo.com> MIME-Version: 1.0 References: <443019651.1678894.1528375563310.ref@mail.yahoo.com> X-Mailer: WebService/1.1.11950 YahooMailBasic Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 Subject: Re: [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 12:46:05 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit There is a mistake in sign in the patch I posted ===== diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -962,7 +962,7 @@ WriteSections64 ( VerboseMsg ("Offset: 0x%08X, Addend: 0x%08X", (UINT32)(SecOffset + (Rel->r_offset - SecShdr->sh_addr)), *(UINT32 *)Targ); - GOTEntryRva = Rel->r_offset - Rel->r_addend + *(UINT32 *)Targ; + GOTEntryRva = Rel->r_offset - Rel->r_addend + *(INT32 *)Targ; FindElfGOTSectionFromGOTEntryElfRva(GOTEntryRva); *(UINT32 *)Targ = (UINT32) (*(UINT32 *)Targ + (mCoffSectionsOffset[mGOTShindex] - mGOTShdr->sh_addr) ===== (Displacement should be sign-extended to 64 bit for this calc.) It did not surface because in single-text section ELF file, displacement from instructions to GOT entries are always positive. I will repost the whole patch with this change. -------------------------------------------- On Thu, 6/7/18, Gao, Liming wrote: Subject: RE: [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw To: "Zenith432" , "edk2-devel@lists.01.org" Cc: "Shi, Steven" , "Zhu, Yonghong" Date: Thursday, June 7, 2018, 4:32 AM What's purpose to support GOTPCREL in GenFw? Could you introduce your usage model?