mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
board_f: fix calculation of reloc_off
relocate_code() calculates the relocation offset wrt. the symbol __image_copy_start which happens to have the same value as CONFIG_TEXT_BASE on most systems. When creating an i.MX boot image with an integrated IVT it is convenient to have CONFIG_TEXT_BASE point to the start of the IVT that is prepended to the actual code. Thus CONFIG_TEXT_BASE will differ from __image_copy_start, while the calculation 'gd->relocaddr - __image_copy_start' still gives the right relocation offset. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
This commit is contained in:
@ -644,13 +644,16 @@ static int setup_reloc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_TEXT_BASE
|
#ifdef CONFIG_SYS_TEXT_BASE
|
||||||
gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
|
#ifdef ARM
|
||||||
#ifdef CONFIG_M68K
|
gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
|
||||||
|
#elif defined(CONFIG_M68K)
|
||||||
/*
|
/*
|
||||||
* On all ColdFire arch cpu, monitor code starts always
|
* On all ColdFire arch cpu, monitor code starts always
|
||||||
* just after the default vector table location, so at 0x400
|
* just after the default vector table location, so at 0x400
|
||||||
*/
|
*/
|
||||||
gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
|
gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
|
||||||
|
#else
|
||||||
|
gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
|
memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
|
||||||
|
Reference in New Issue
Block a user