From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: compressed: put zImage header and EFI header in dedicated section
Date: Mon, 5 Nov 2018 19:44:37 +0100 [thread overview]
Message-ID: <20181105184438.19494-6-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20181105184438.19494-1-ard.biesheuvel@linaro.org>
To align the PE/COFF and the ELF headers of the decompressor binary, put
the zImage header and the EFI header in a separate .start section, and
emit it at the start of the Image. This change is necessary for UEFI
based debug tooling to be able to use the vmlinux ELF binary, since it
gets confused if the PE/COFF .text section and the ELF .text section live
at different offsets.
With this change, we also stop relying on the code to flow from one
section to the next simply because the order in which the linker emits
the sections happens to be what we expect.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
arch/arm/boot/compressed/head.S | 6 +++---
arch/arm/boot/compressed/vmlinux.lds.S | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 55c227077207..e3c43fdb6371 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -176,6 +176,8 @@ start:
.word _magic_table @ additional data table
__EFI_HEADER
+
+ .text
1:
ARM_BE8( setend be ) @ go BE8 if compiled for BE8
AR_CLASS( mrs r9, cpsr )
@@ -209,10 +211,8 @@ not_angel:
/*
* some architecture specific code can be inserted
- * by the linker here, but it should preserve r7, r8, and r9.
+ * here, but it should preserve r7, r8, and r9.
*/
-
- .text
#ifdef CONFIG_PXA_SHARPSL_DETECT_MACH_ID
bl __SharpSL_start
#endif
diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S
index 2b963d8e76dd..ad9921490034 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.S
+++ b/arch/arm/boot/compressed/vmlinux.lds.S
@@ -34,9 +34,11 @@ SECTIONS
. = TEXT_START;
_text = .;
- .text : {
+ .start : {
_start = .;
*(.start)
+ }
+ .text : {
*(.text)
*(.text.*)
*(.fixup)
--
2.19.1
next prev parent reply other threads:[~2018-11-05 18:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 18:44 [PATCH 0/6] ARM: compressed: clean up section layout and enable EFI debugging Ard Biesheuvel
2018-11-05 18:44 ` [PATCH 1/6] ARM: compressed: move sharpsl startup code into subroutine Ard Biesheuvel
2018-11-05 18:59 ` Russell King - ARM Linux
2018-11-05 19:07 ` Ard Biesheuvel
2018-11-05 19:13 ` Russell King - ARM Linux
2018-11-05 19:25 ` Nicolas Pitre
2018-11-05 19:35 ` Ard Biesheuvel
2018-11-05 18:44 ` [PATCH 2/6] ARM: compressed: move sa1100 " Ard Biesheuvel
2018-11-05 19:00 ` Russell King - ARM Linux
2018-11-05 18:44 ` [PATCH 3/6] ARM: compressed: move xscale " Ard Biesheuvel
2018-11-05 19:00 ` Russell King - ARM Linux
2018-11-05 18:44 ` [PATCH 4/6] ARM: compressed: move BE32 handling into head.S Ard Biesheuvel
2018-11-05 18:44 ` Ard Biesheuvel [this message]
2018-11-05 18:44 ` [PATCH 6/6] ARM: efi: add PE/COFF debug table to EFI header Ard Biesheuvel
2018-11-05 19:09 ` [PATCH 0/6] ARM: compressed: clean up section layout and enable EFI debugging Russell King - ARM Linux
2018-11-05 19:10 ` Ard Biesheuvel
2018-11-05 19:14 ` Russell King - ARM Linux
2018-11-05 19:21 ` 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-all 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=20181105184438.19494-6-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).