mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 04/12] ARM: Add image end section
Date: Tue, 25 Jun 2013 11:20:44 +0200	[thread overview]
Message-ID: <1372152052-5463-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1372152052-5463-1-git-send-email-s.hauer@pengutronix.de>

In the upcoming multi image build process we will cat images together.
To find the concatenated image we need to reliably find the end of the
current binary. This adds a dummy section at the end of a pbl binary.
Its only purpose is to mark the end of the image. The multi image
patches will add something to this section so that it doesn't get
discarded by the linker.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/lib/pbl.lds.S         | 8 +++++++-
 arch/arm/lib/runtime-offset.S  | 3 +++
 include/asm-generic/sections.h | 1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S
index d3ec2f8..1eae829 100644
--- a/arch/arm/lib/pbl.lds.S
+++ b/arch/arm/lib/pbl.lds.S
@@ -86,6 +86,12 @@ SECTIONS
 	}
 	__piggydata_end = .;
 
-	_barebox_image_size = __piggydata_end - (TEXT_BASE - SZ_2M);
+	. = ALIGN(4);
+	.image_end : {
+		KEEP(*(.image_end))
+	}
+	__image_end = .;
+
+	_barebox_image_size = __image_end - (TEXT_BASE - SZ_2M);
 	_barebox_pbl_size = __bss_start - (TEXT_BASE - SZ_2M);
 }
diff --git a/arch/arm/lib/runtime-offset.S b/arch/arm/lib/runtime-offset.S
index 15bf414..f10c4c8 100644
--- a/arch/arm/lib/runtime-offset.S
+++ b/arch/arm/lib/runtime-offset.S
@@ -42,6 +42,9 @@ ld_var_entry __dynsym_end
 ld_var_entry _barebox_image_size
 ld_var_entry __bss_start
 ld_var_entry __bss_stop
+#ifdef __PBL__
+ld_var_entry __image_end
+#endif
 
 1:
 	ldr r1, =__ld_var_base
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 5492aa4..984f8b6 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -6,6 +6,7 @@ extern char __bss_start[], __bss_stop[];
 extern char _sdata[], _edata[];
 extern char __bare_init_start[], __bare_init_end[];
 extern char _end[];
+extern char __image_end[];
 extern void *_barebox_image_size;
 extern void *_barebox_bare_init_size;
 extern void *_barebox_pbl_size;
-- 
1.8.3.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-06-25  9:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25  9:20 [PATCH] barebox multi image support Sascha Hauer
2013-06-25  9:20 ` [PATCH 01/12] ARM: split barebox_arm_head in two separate functions Sascha Hauer
2013-06-25  9:20 ` [PATCH 02/12] ARM: pbl: move linker script to lib Sascha Hauer
2013-06-25  9:20 ` [PATCH 03/12] ARM: build dtbs unconditionally Sascha Hauer
2013-06-25  9:20 ` Sascha Hauer [this message]
2013-06-25  9:20 ` [PATCH 05/12] imx-image: fix path to imx-image binary Sascha Hauer
2013-06-25  9:20 ` [PATCH 06/12] Add multi images support Sascha Hauer
2013-06-25  9:20 ` [PATCH 07/12] ARM: i.MX: Add multi images support Makefile Sascha Hauer
2013-06-25  9:20 ` [PATCH 08/12] ARM: i.MX27 pcm038: switch to multi image Sascha Hauer
2013-06-25  9:20 ` [PATCH 09/12] ARM: i.MX53 loco: Switch to imximage Sascha Hauer
2013-06-25  9:20 ` [PATCH 10/12] ARM: i.MX53 loco: Switch to multi image support Sascha Hauer
2013-06-25  9:20 ` [PATCH 11/12] ARM: dmo realq7: switch " Sascha Hauer
2013-06-25  9:20 ` [PATCH 12/12] ARM: i.MX51 babbage: " Sascha Hauer
2013-06-25  9:26 ` [PATCH] barebox " Sascha Hauer
2013-06-26  5:27 ` Sascha Hauer
2013-06-26  5:27   ` [PATCH 1/2] ARM: Allow to pass a devicetree via boarddata Sascha Hauer
2013-06-26  5:27   ` [PATCH 2/2] ARM: dts: Add .S files as secondary target Sascha Hauer

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=1372152052-5463-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@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