summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Brodkin <abrodkin@synopsys.com>2014-12-26 19:36:30 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2015-01-15 22:38:42 +0300
commit1c91a3d9790c6d8f4bcb0d896936672509a1439d (patch)
tree42b5a9506b35a7fa45dac57221d5b1bdff9e66f2
parent20a58ac0d8e09d0bf1a74c6b68fea22784512b51 (diff)
downloadu-boot-imx-1c91a3d9790c6d8f4bcb0d896936672509a1439d.zip
u-boot-imx-1c91a3d9790c6d8f4bcb0d896936672509a1439d.tar.gz
u-boot-imx-1c91a3d9790c6d8f4bcb0d896936672509a1439d.tar.bz2
arc: relocate - minor refactoring and clean-up
* use better symbols for relocatable region boundaries ("__image_copy_start" instead of "CONFIG_SYS_TEXT_BASE") * remove useless debug messages because they will only show up in case of both problem (when normal "if" branch won't be taken) and DEBUG take place which is pretty rare situation. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
-rw-r--r--arch/arc/include/asm/sections.h1
-rw-r--r--arch/arc/lib/relocate.c15
2 files changed, 5 insertions, 11 deletions
diff --git a/arch/arc/include/asm/sections.h b/arch/arc/include/asm/sections.h
index 2a7a987..b8f2a85 100644
--- a/arch/arc/include/asm/sections.h
+++ b/arch/arc/include/asm/sections.h
@@ -12,5 +12,6 @@
extern ulong __text_end;
extern ulong __ivt_start;
extern ulong __ivt_end;
+extern ulong __image_copy_start;
#endif /* __ASM_ARC_SECTIONS_H */
diff --git a/arch/arc/lib/relocate.c b/arch/arc/lib/relocate.c
index 5618b6a..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 */
@@ -48,9 +48,9 @@ int do_elf_reloc_fixups(void)
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 */
@@ -59,14 +59,7 @@ int do_elf_reloc_fixups(void)
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;