summaryrefslogtreecommitdiff
path: root/arch/arc/lib/relocate.c
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2015-02-13 11:17:01 +0100
committerStefano Babic <sbabic@denx.de>2015-02-13 11:17:01 +0100
commite72d344386bf80738fab7a6bd37cb321f443093a (patch)
treed3e02055e6aa903ab80ef87c78d2f38e93981dcf /arch/arc/lib/relocate.c
parent258c98f8d36ef35d7cb7604847ba73e64d702c2a (diff)
parentbd2a4888b123713adec271d6c8040ca9f609aa2f (diff)
downloadu-boot-imx-e72d344386bf80738fab7a6bd37cb321f443093a.zip
u-boot-imx-e72d344386bf80738fab7a6bd37cb321f443093a.tar.gz
u-boot-imx-e72d344386bf80738fab7a6bd37cb321f443093a.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot
Diffstat (limited to 'arch/arc/lib/relocate.c')
-rw-r--r--arch/arc/lib/relocate.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/arc/lib/relocate.c b/arch/arc/lib/relocate.c
index 2482bcd..7797782 100644
--- a/arch/arc/lib/relocate.c
+++ b/arch/arc/lib/relocate.c
@@ -26,7 +26,7 @@ int do_elf_reloc_fixups(void)
offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;
/* Check that the location of the relocation is in .text */
- if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE &&
+ if (offset_ptr_rom >= (Elf32_Addr *)&__image_copy_start &&
offset_ptr_rom > last_offset) {
unsigned int val;
/* Switch to the in-RAM version */
@@ -44,29 +44,22 @@ int do_elf_reloc_fixups(void)
#ifdef __LITTLE_ENDIAN__
/* If location in ".text" section swap value */
if ((unsigned int)offset_ptr_rom <
- (unsigned int)&__text_end)
+ (unsigned int)&__ivt_end)
val = (val << 16) | (val >> 16);
#endif
- /* Check that the target points into .text */
- if (val >= CONFIG_SYS_TEXT_BASE && val <=
- (unsigned int)&__bss_end) {
+ /* Check that the target points into executable */
+ if (val >= (unsigned int)&__image_copy_start && val <=
+ (unsigned int)&__image_copy_end) {
val += gd->reloc_off;
#ifdef __LITTLE_ENDIAN__
/* If location in ".text" section swap value */
if ((unsigned int)offset_ptr_rom <
- (unsigned int)&__text_end)
+ (unsigned int)&__ivt_end)
val = (val << 16) | (val >> 16);
#endif
memcpy(offset_ptr_ram, &val, sizeof(int));
- } else {
- debug(" %p: rom reloc %x, ram %p, value %x, limit %x\n",
- re_src, re_src->r_offset, offset_ptr_ram,
- val, (unsigned int)&__bss_end);
}
- } else {
- debug(" %p: rom reloc %x, last %p\n", re_src,
- re_src->r_offset, last_offset);
}
last_offset = offset_ptr_rom;