diff options
author | Gabe Black <gabeblack@chromium.org> | 2011-06-17 22:18:11 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:39:30 -0700 |
commit | 54142dc58f6df309969e1e81026c3c1a654eb814 (patch) | |
tree | e83acb62e2324a19de043441ff6153f79f0dfc37 /arch/x86 | |
parent | fa582200543391e80f43c9eef0cc9b394c674df9 (diff) |
Fix a bug determining the size of memory moved into RAM.
The code which decided what symbols to relocate based on whether or not their
targets had been relocated into RAM calculated the size of the memory moved by
subtracting two pointers. Unfortunately, these pointers were not byte sized and
the size was too small by a factor of 4. This change casts them to uintptr_t so
that the size is calculated correctly.
BUG=chrome-os-partner:3895
TEST=Built and booted with this change, and verified that odd behaviors went
away, like the "help" command working erratically.
Change-Id: Ic9e37fce73db4b896bbf8acd31a09997baa6be77
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/2855
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/lib/board.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c index ce894a6eb9e..63ca6551af9 100644 --- a/arch/x86/lib/board.c +++ b/arch/x86/lib/board.c @@ -240,7 +240,8 @@ static int do_elf_reloc_fixups(void) Elf32_Rel *re_end = (Elf32_Rel *)(&__rel_dyn_end); /* The size of the region of u-boot that runs out of RAM. */ - uintptr_t size = &__bss_end - &__text_start; + uintptr_t size = (uintptr_t)&__bss_end - + (uintptr_t)&__text_start; do { if (re_src->r_offset >= CONFIG_SYS_TEXT_BASE) { |