From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] ARM: get runtime offset of board_init_lowlevel_return by using separate section
Date: Tue, 28 Feb 2012 09:56:40 +0100 [thread overview]
Message-ID: <1330419401-11994-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1330419401-11994-1-git-send-email-s.hauer@pengutronix.de>
We used to get the runtime offset of the board_init_lowlevel_return
by doing a &board_init_lowlevel_return. This does not work in thumb-2
mode, so use a separate linker section for this function instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/cpu/start.c | 4 ++--
arch/arm/include/asm/barebox-arm.h | 1 +
arch/arm/lib/barebox.lds.S | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 1a1538e..89aff1d 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -109,7 +109,7 @@ void __naked __bare_init reset(void)
* Board code can jump here by either returning from board_init_lowlevel
* or by calling this funtion directly.
*/
-void __naked __bare_init board_init_lowlevel_return(void)
+void __naked __section(.text_ll_return) board_init_lowlevel_return(void)
{
uint32_t r, addr;
@@ -124,7 +124,7 @@ void __naked __bare_init board_init_lowlevel_return(void)
__asm__ __volatile__("mov sp, %0" : : "r"(r));
/* Get start of binary image */
- addr -= (uint32_t)&board_init_lowlevel_return - TEXT_BASE;
+ addr -= (uint32_t)&__ll_return - TEXT_BASE;
/* relocate to link address if necessary */
if (addr != TEXT_BASE)
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 3339782..b880dd4 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -37,6 +37,7 @@ int board_init(void);
int dram_init (void);
extern char __exceptions_start[], __exceptions_stop[];
+extern char __ll_return[];
void board_init_lowlevel(void);
void board_init_lowlevel_return(void);
diff --git a/arch/arm/lib/barebox.lds.S b/arch/arm/lib/barebox.lds.S
index 531e3d0..bc20694 100644
--- a/arch/arm/lib/barebox.lds.S
+++ b/arch/arm/lib/barebox.lds.S
@@ -39,6 +39,8 @@ SECTIONS
_stext = .;
_text = .;
*(.text_entry*)
+ __ll_return = .;
+ *(.text_ll_return*)
#ifdef CONFIG_ARCH_EP93XX
/* the EP93xx expects to find the pattern 'CRUS' at 0x1000 */
. = 0x1000;
--
1.7.9.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-02-28 8:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 8:56 [PATCH] Thumb2 support Sascha Hauer
2012-02-28 8:56 ` [PATCH 1/3] ARM: move exception vectors away from start of binary Sascha Hauer
2012-02-28 8:56 ` Sascha Hauer [this message]
2012-02-29 18:19 ` [PATCH 2/3] ARM: get runtime offset of board_init_lowlevel_return by using separate section Jean-Christophe PLAGNIOL-VILLARD
2012-02-28 8:56 ` [PATCH 3/3] ARM: Allow to compile in thumb-2 mode Sascha Hauer
2012-02-29 18:21 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-29 19:23 ` Sascha Hauer
2012-03-01 4:40 ` Jean-Christophe PLAGNIOL-VILLARD
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=1330419401-11994-3-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