public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bob Feng" <bob.c.feng@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"ard.biesheuvel@arm.com" <ard.biesheuvel@arm.com>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Leif Lindholm <leif@nuviainc.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Julien Grall <julien@xen.org>,
	"Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/4] BaseTools/Scripts/GccBase.lds: export image base symbol
Date: Fri, 12 Jun 2020 05:22:48 +0000	[thread overview]
Message-ID: <BN6PR11MB0068CE1B63D0AEAC1BEED926C9810@BN6PR11MB0068.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200608173413.1100679-3-ard.biesheuvel@arm.com>

Reviewed-by: Bob Feng<bob.c.feng@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ard Biesheuvel
Sent: Tuesday, June 9, 2020 1:34 AM
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; Laszlo Ersek <lersek@redhat.com>; Leif Lindholm <leif@nuviainc.com>; Ilias Apalodimas <ilias.apalodimas@linaro.org>; Julien Grall <julien@xen.org>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [edk2-devel] [PATCH 2/4] BaseTools/Scripts/GccBase.lds: export image base symbol

To help converted ELF images perform self-relocation, export a symbol 'ElfImageBase' that can be used in the code to discover the start of the image in memory.

Note the use of PROVIDE() - this ensures that the symbol is only emitted if a reference to it exists in the code being linked, but no definition.
This means the symbol is never emitted in a way that can conflict with existing code.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 BaseTools/Scripts/GccBase.lds | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/BaseTools/Scripts/GccBase.lds b/BaseTools/Scripts/GccBase.lds index a9dd2138d4b5..e73c1206a2e2 100644
--- a/BaseTools/Scripts/GccBase.lds
+++ b/BaseTools/Scripts/GccBase.lds
@@ -12,6 +12,8 @@
  SECTIONS { +  PROVIDE(ElfImageBase = .);+   /*    * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequence of    * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs-- 
2.26.2


-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#60893): https://edk2.groups.io/g/devel/message/60893
Mute This Topic: https://groups.io/mt/74757210/1768742
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [bob.c.feng@intel.com] -=-=-=-=-=-=


  parent reply	other threads:[~2020-06-12  5:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 17:34 [PATCH 0/4] ArmVirtPkg: use PE/COFF metadata for self relocation Ard Biesheuvel
2020-06-08 17:34 ` [PATCH 1/4] ArmVirtPkg: add FDF rule for self-relocating PrePi Ard Biesheuvel
2020-06-09 20:33   ` [edk2-devel] " Laszlo Ersek
2020-06-08 17:34 ` [PATCH 2/4] BaseTools/Scripts/GccBase.lds: export image base symbol Ard Biesheuvel
2020-06-10 21:48   ` Ard Biesheuvel
2020-06-12  5:22   ` Bob Feng [this message]
2020-06-08 17:34 ` [PATCH 3/4] ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocation Ard Biesheuvel
2020-06-09 20:35   ` [edk2-devel] " Laszlo Ersek
2020-06-08 17:34 ` [PATCH 4/4] ArmVirtPkg: remove unused files Ard Biesheuvel
2020-06-09 20:36   ` [edk2-devel] " Laszlo Ersek
2020-06-09  0:00 ` [PATCH 0/4] ArmVirtPkg: use PE/COFF metadata for self relocation Yao, Jiewen
2020-06-09 10:29 ` Julien Grall
2020-06-10 20:35   ` [edk2-devel] " Sami Mujawar

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=BN6PR11MB0068CE1B63D0AEAC1BEED926C9810@BN6PR11MB0068.namprd11.prod.outlook.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