[U-Boot] [PATCH] [x86] Wrap small helper functions from libgcc to avoid an ABI mismatch

Gabe Black gabeblack at chromium.org
Tue Nov 8 23:27:29 CET 2011


On Tue, Nov 8, 2011 at 5:33 AM, Mike Frysinger <vapier at gentoo.org> wrote:

> On Tuesday 08 November 2011 04:27:44 Gabe Black wrote:
> > When gcc compiles some 64 bit operations on a 32 bit machine, it
> generates
> > calls to small functions instead of instructions which do the job
> directly.
> > Those functions are defined in libgcc and transparently provide whatever
> > functionality was necessary. Unfortunately, u-boot can be built with a
> > non-standard ABI when libgcc isn't. When the two are linked together,
> very
> > confusing bugs can crop up, for instance seemingly normal integer
> division
> > or modulus getting the wrong answer or even raising a spurious divide by
> > zero exception.
>
> might be good to explicitly mention that this is due to u-boot using
> -mregparm
>
> > --- a/arch/x86/config.mk
> > +++ b/arch/x86/config.mk
> >
> > +LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
>
> looks like some old code sneaked in.  bad rebase ?
>

Yep, that's right. The original change doesn't have that line so it must
have slipped in during a rebase.

Gabe


More information about the U-Boot mailing list