public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Zenith432 <zenith432@users.sourceforge.net>
To: LimingGao <liming.gao@intel.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	 StevenShi <steven.shi@intel.com>
Subject: Re: [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw
Date: Thu, 7 Jun 2018 12:46:03 +0000 (UTC)	[thread overview]
Message-ID: <443019651.1678894.1528375563310@mail.yahoo.com> (raw)
In-Reply-To: 443019651.1678894.1528375563310.ref@mail.yahoo.com

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 <liming.gao@intel.com> wrote:

 Subject: RE: [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw
 To: "Zenith432" <zenith432@users.sourceforge.net>, "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
 Cc: "Shi, Steven" <steven.shi@intel.com>, "Zhu, Yonghong" <yonghong.zhu@intel.com>
 Date: Thursday, June 7, 2018, 4:32 AM
 
 What's purpose to support GOTPCREL in GenFw?
 Could you introduce your usage model?
 
 


       reply	other threads:[~2018-06-07 12:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <443019651.1678894.1528375563310.ref@mail.yahoo.com>
2018-06-07 12:46 ` Zenith432 [this message]
     [not found] <1082615057.1616071.1528351716579.ref@mail.yahoo.com>
2018-06-07  6:08 ` [PATCH] BaseTools/GenFw: Add X64 GOTPCREL Support to GenFw Zenith432
2018-06-08  0:32   ` Shi, Steven
     [not found] <1501305711.1573406.1528351473858.ref@mail.yahoo.com>
2018-06-07  6:04 ` Zenith432
     [not found] <1821667922.1236806.1528308060822.ref@mail.yahoo.com>
2018-06-06 18:01 ` Zenith432
2018-06-07  1:32   ` Gao, Liming
2018-06-07  2:15     ` Shi, Steven
2018-06-07  2:17       ` Shi, Steven
2018-06-07  2:24         ` Shi, Steven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443019651.1678894.1528375563310@mail.yahoo.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox