diff mbox

[U-Boot] x86: Fix a recently added bug in the relocation code

Message ID 1321332926-4233-1-git-send-email-gabeblack@chromium.org
State Superseded
Delegated to: Graeme Russ
Headers show

Commit Message

Gabe Black Nov. 15, 2011, 4:55 a.m. UTC
Signed-off-by: Gabe Black <gabeblack@chromium.org>
---
 arch/x86/lib/board.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Gabe Black Nov. 15, 2011, 6:05 a.m. UTC | #1
On Mon, Nov 14, 2011 at 8:58 PM, Graeme Russ <graeme.russ@gmail.com> wrote:

> Gabe,
>
> On Tue, Nov 15, 2011 at 3:55 PM, Gabe Black <gabeblack@chromium.org>
> wrote:
> > Signed-off-by: Gabe Black <gabeblack@chromium.org>
> > ---
> >  arch/x86/lib/board.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> > index 18e0ede..4a791dd 100644
> > --- a/arch/x86/lib/board.c
> > +++ b/arch/x86/lib/board.c
> > @@ -220,6 +220,9 @@ static int do_elf_reloc_fixups(void)
> >        Elf32_Addr *offset_ptr_rom;
> >        Elf32_Addr *offset_ptr_ram;
> >
> > +       /* The size of the region of u-boot that runs out of RAM. */
> > +       uintptr_t size = (uintptr_t)&__bss_end -
> (uintptr_t)&__text_start;
> > +
> >        do {
> >                /* Get the location from the relocation entry */
> >                offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;
> > --
>
> Do you have any objections to me adding my fix into this with dual
> SoB? I figured it was the same function and the bugs are the same
> vintage, so may as well hit two birds with one stone
>
> Regards,
>
> Graeme
>


That's fine with me, go ahead.

Gabe
diff mbox

Patch

diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 18e0ede..4a791dd 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -220,6 +220,9 @@  static int do_elf_reloc_fixups(void)
 	Elf32_Addr *offset_ptr_rom;
 	Elf32_Addr *offset_ptr_ram;
 
+	/* The size of the region of u-boot that runs out of RAM. */
+	uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;
+
 	do {
 		/* Get the location from the relocation entry */
 		offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;