[U-Boot-Users] Changing u-boot relocation scheme

Joakim Tjernlund Joakim.Tjernlund at transmode.se
Sat Jul 26 16:29:17 CEST 2008


> -----Original Message-----
> From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net]
> On Behalf Of Jean-Christophe PLAGNIOL-VILLARD
> Sent: den 26 juli 2008 16:03
> To: Grant Likely
> Cc: u-boot-users at lists.sourceforge.net; Wolfgang Denk; vb; Jerry Van Baren; Haavard Skinnemoen
> Subject: Re: [U-Boot-Users] Changing u-boot relocation scheme
> 
> On 01:57 Sat 26 Jul     , Grant Likely wrote:
> > On Fri, Jul 25, 2008 at 1:28 PM, kenneth johansson <kenneth at southpole.se> wrote:
> > > I was afraid that what was needed was more or less a complete linker but
> > > it looks like if one generate the dynamic reloc table a much simpler
> > > linker(relocation function) is needed. Still probably a lot more complex
> > > than the GOT and fixup code that is just a loop over a table. We may
> > > need a case also ;-)
> >
> > The GOT relocation works.  It works really well.  As long as gcc and
> > ld put the correct GOT bits into the GOT table.  It seems not all
> > versions of gcc do it in the same way with the same flags.
> 
> Why not set the code depending on the GCC version?

For fun I had a look into eabi.asm code at 
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/eabi.asm?rev=1.13&content-type=text/x-cvsweb-markup
and I noticed one difference:
The __eabi_uconvert() function skips NULL ptrs.

Perhaps this is the missing piece needed in start.S for PPC?

__eabi_convert pasted below for convenience.

    Jocke

FUNC_START(__eabi_convert)
        cmplw   1,3,4                                /* any pointers to convert? */
        subf    5,3,4                                /* calculate number of words to convert */
        bclr    4,4                                /* return if no pointers */

        srawi   5,5,2
        addi        3,3,-4                                /* start-4 for use with lwzu */
        mtctr   5

.Lcvt:
        lwzu        6,4(3)                                /* pointer to convert */
        cmpwi        0,6,0
        beq-        .Lcvt2                                /* if pointer is null, don't convert */

        add     6,6,12                                /* convert pointer */
        stw     6,0(3)
.Lcvt2:
        bdnz+   .Lcvt
        blr





More information about the U-Boot mailing list