[U-Boot] U-Boot Relocation (all sections, not just .text)

Haavard Skinnemoen haavard.skinnemoen at atmel.com
Fri Oct 10 13:55:49 CEST 2008


"Graeme Russ" <graeme.russ at gmail.com> wrote:
>  - Am I looking at the problem the wrong way?

No, I think you're on the right track.

>  - Has anyone here looked into making U-Boot 100% relocatable before?

I've looked at it briefly and come to the conclusion that -pie is
probably the way to go. But I haven't written any code to confirm this.

>  - Is U-Boot already 100% relocatable (not just code) for any other
>    platforms?

I think there are patches for PowerPC somewhere.

>  - Has anyone here used pie before and had to write code to adjust
>    the offset tables?

I haven't, but it's on my TODO list for AVR32. I suspect the code will
be very similar to the relocation code in the dynamic linker.

That said, the current AVR32 code does relocate the GOT. The only
remaining piece is relocating statically initialized pointers.

>  - Does anyone know of a good reference for pie / .got / elf (I have
>    found bits and pieces here and there, but no definitive reference)

Perhaps the i386 ABI spec will provide some hints. The dynamic linker
code in glibc or uClibc might also be worth a look.

Haavard


More information about the U-Boot mailing list