summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-12-10 16:05:16 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-02-28 09:55:04 +0100
commitcb1bd905dcacd8abd2703f6ce61fc09db8e475a4 (patch)
treeaddaada49b82c83857f25bcb591d37b59baf8507
parent2c2d00a2816099ef90c149562b9f939048742c1f (diff)
downloadbarebox-cb1bd905dcacd8abd2703f6ce61fc09db8e475a4.tar.gz
barebox-cb1bd905dcacd8abd2703f6ce61fc09db8e475a4.tar.xz
ARM: get runtime offset of board_init_lowlevel_return by using separate section
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>
-rw-r--r--arch/arm/cpu/start.c4
-rw-r--r--arch/arm/include/asm/barebox-arm.h1
-rw-r--r--arch/arm/lib/barebox.lds.S2
3 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 1a1538e5e3..89aff1dc05 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 333978241c..b880dd49b3 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 531e3d0e87..bc20694945 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;