@ -26,7 +26,7 @@ int do_elf_reloc_fixups(void)
offset_ptr_rom = ( Elf32_Addr * ) re_src - > r_offset ;
offset_ptr_rom = ( Elf32_Addr * ) re_src - > r_offset ;
/* Check that the location of the relocation is in .text */
/* 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 ) {
offset_ptr_rom > last_offset ) {
unsigned int val ;
unsigned int val ;
/* Switch to the in-RAM version */
/* Switch to the in-RAM version */
@ -48,9 +48,9 @@ int do_elf_reloc_fixups(void)
val = ( val < < 16 ) | ( val > > 16 ) ;
val = ( val < < 16 ) | ( val > > 16 ) ;
# endif
# endif
/* Check that the target points into .t ext */
/* Check that the target points into execu table */
if ( val > = CONFIG_SYS_TEXT_BASE & & val < =
if ( val > = ( unsigned int ) & __image_copy_start & & val < =
( unsigned int ) & __bss _end ) {
( unsigned int ) & __image_copy _end ) {
val + = gd - > reloc_off ;
val + = gd - > reloc_off ;
# ifdef __LITTLE_ENDIAN__
# ifdef __LITTLE_ENDIAN__
/* If location in ".text" section swap value */
/* If location in ".text" section swap value */
@ -59,14 +59,7 @@ int do_elf_reloc_fixups(void)
val = ( val < < 16 ) | ( val > > 16 ) ;
val = ( val < < 16 ) | ( val > > 16 ) ;
# endif
# endif
memcpy ( offset_ptr_ram , & val , sizeof ( int ) ) ;
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 ;
last_offset = offset_ptr_rom ;