u-boot/arch
Simon Glass 62f7970a5a x86: Add error checking to x86 relocation code
This does not actually change normal behaviour, but adds a check that
should detect corruption of relocation data (e.g. by using BSS data
prior to relocation).

Also add additional debugging output when enabled.

During this investigation, two situations have been seen:
1. calculate_relocation_address():
	uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;

turns into
     111166f:	b8 83 c4 17 01       	mov    $0x117c483,%eax

whih is beyond the end of bss:

0117b484 g       .bss	00000000 __bss_end

Somehow the __bss_end here is 255 bytes ahead.

2. do_elf_reloc_fixups():

	uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;

Here the __text_start is 0 in the file:

 1111d9f:	bb a0 e0 13 01       	mov    $0x113e0a0,%ebx
1111da4:	81 ef 00 00 00 00    	sub    $0x0,%edi

As it happens, both of these are in pre-relocation code.

For these reasons we silent check and ignore bad relocations.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-03-04 15:57:48 -08:00
..
arm mac: Fix the condition check for setting the MAC from the EEPROM 2013-02-20 08:52:41 -05:00
avr32 malloc: make malloc_bin_reloc static 2013-02-19 17:01:26 -05:00
blackfin blackfin: bf60x: add resume from hibernate 2013-03-04 13:42:08 +08:00
m68k malloc: make malloc_bin_reloc static 2013-02-19 17:01:26 -05:00
microblaze Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2013-02-04 09:14:22 -05:00
mips MIPS: board.c: remove manual relocation of env_name_spec 2013-02-15 18:00:04 +01:00
nds32 malloc: make malloc_bin_reloc static 2013-02-19 17:01:26 -05:00
nios2 Clean up libfdt.h includes 2013-02-08 22:32:38 -05:00
openrisc openrisc: Use generic global_data 2013-02-04 09:05:46 -05:00
powerpc Clean up libfdt.h includes 2013-02-08 22:32:38 -05:00
sandbox sandbox: Add a way of obtaining directory listings 2013-03-04 14:19:56 -05:00
sh sh: Use generic global_data 2013-02-04 09:05:46 -05:00
sparc malloc: make malloc_bin_reloc static 2013-02-19 17:01:26 -05:00
x86 x86: Add error checking to x86 relocation code 2013-03-04 15:57:48 -08:00
.gitignore update include/asm/ gitignore after move 2010-05-07 00:17:30 +02:00