public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Leif Lindholm <leif@nuviainc.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Julien Grall <julien@xen.org>, Jiewen Yao <jiewen.yao@intel.com>,
	Sami Mujawar <Sami.Mujawar@arm.com>,
	Jiewen Yao <Jiewen.yao@intel.com>
Subject: [PATCH v2 1/3] ArmVirtPkg: add FDF rule for self-relocating PrePi
Date: Thu, 11 Jun 2020 14:52:26 +0200	[thread overview]
Message-ID: <20200611125228.252500-2-ard.biesheuvel@arm.com> (raw)
In-Reply-To: <20200611125228.252500-1-ard.biesheuvel@arm.com>

In preparation for making the self-relocating PrePi use the ordinary
BasePeCoffLib routines for relocating the image in place in memory
at start, add a special FDF rule that builds SEC modules as PE32
images with the relocation metadata preserved.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Sami Mujawar <Sami.Mujawar@arm.com>
---
 ArmVirtPkg/ArmVirtQemuKernel.fdf | 2 +-
 ArmVirtPkg/ArmVirtXen.fdf        | 2 +-
 ArmVirtPkg/ArmVirtRules.fdf.inc  | 5 +++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ArmVirtPkg/ArmVirtQemuKernel.fdf b/ArmVirtPkg/ArmVirtQemuKernel.fdf
index 72fc8dd698f8..55e33aba0d55 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.fdf
+++ b/ArmVirtPkg/ArmVirtQemuKernel.fdf
@@ -136,7 +136,7 @@ [FV.FVMAIN_COMPACT]
 READ_LOCK_CAP      = TRUE
 READ_LOCK_STATUS   = TRUE
 
-  INF ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
+  INF RuleOverride = SELF_RELOC ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
 
   FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
     SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf
index 6a97bceeacbc..f708878f4965 100644
--- a/ArmVirtPkg/ArmVirtXen.fdf
+++ b/ArmVirtPkg/ArmVirtXen.fdf
@@ -233,7 +233,7 @@ [FV.FVMAIN_COMPACT]
 READ_LOCK_CAP      = TRUE
 READ_LOCK_STATUS   = TRUE
 
-  INF ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
+  INF RuleOverride = SELF_RELOC ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
 
   FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
     SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
diff --git a/ArmVirtPkg/ArmVirtRules.fdf.inc b/ArmVirtPkg/ArmVirtRules.fdf.inc
index 63de26abe056..b8ec040d2330 100644
--- a/ArmVirtPkg/ArmVirtRules.fdf.inc
+++ b/ArmVirtPkg/ArmVirtRules.fdf.inc
@@ -39,6 +39,11 @@ [Rule.Common.SEC]
     TE  TE Align = Auto                 $(INF_OUTPUT)/$(MODULE_NAME).efi
   }
 
+[Rule.Common.SEC.SELF_RELOC]
+  FILE SEC = $(NAMED_GUID) {
+    TE  TE Align = Auto             $(INF_OUTPUT)/$(MODULE_NAME).efi
+  }
+
 [Rule.Common.PEI_CORE]
   FILE PEI_CORE = $(NAMED_GUID) FIXED {
     TE     TE Align = Auto              $(INF_OUTPUT)/$(MODULE_NAME).efi
-- 
2.26.2


  reply	other threads:[~2020-06-11 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 12:52 [PATCH v2 0/3] ArmVirtPkg: use PE/COFF metadata for self relocation Ard Biesheuvel
2020-06-11 12:52 ` Ard Biesheuvel [this message]
2020-06-11 12:52 ` [PATCH v2 2/3] ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocation Ard Biesheuvel
2020-06-11 12:52 ` [PATCH v2 3/3] ArmVirtPkg: remove unused files Ard Biesheuvel
2020-06-11 17:50 ` [PATCH v2 0/3] ArmVirtPkg: use PE/COFF metadata for self relocation Laszlo Ersek
2020-06-12 22:18   ` Ard Biesheuvel

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=20200611125228.252500-2-ard.biesheuvel@arm.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