9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2011-12-10 16:05:16 +01:00
parent 2c2d00a281
commit cb1bd905dc
3 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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;