[U-Boot] Bug introduced in x86 cleanup patches
Wolfgang Denk
wd at denx.de
Wed Nov 16 00:01:38 CET 2011
Dear Graeme,
In message <CALButCJFYQWb4TtF_nwJgk6HAceEB1PntqZUfK_npXwts3CRyQ at mail.gmail.com> you wrote:
>
> My recent x86 cleanup added a small, but very nasty, bug at line 231 of
> arch/x86/lib/board.c:
>
> offset_ptr_ram = offset_ptr_rom + gd->reloc_off
>
> Because offset_ptr_rom is a pointer, when gd->reloc_off gets added, there
> is a silent 4x multiplication. The solution is (tested):
>
> offset_ptr_ram = (Elf32_Rel *)((ulong)offset_ptr_rom
> + gd->reloc_off);
>
> Or (haven't tested - will test tonight):
>
> offset_ptr_ram = offset_ptr_rom + (Elf32_Rel *)gd->reloc_off;
>
> I have two options
> - Fix it in the existing commit. As it has not been pulled into
> u-boot/master yet, distribution is likely limited to yourself only
> - Add a fixup patch
As far as I'm concerned, I'm OK with a fix in the existing commit and
a rebase of your tree.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Success in marriage is not so much finding the right person as it is
being the right person.
More information about the U-Boot
mailing list