[OpenBIOS] PPC: QEMU breaks static variables in OpenBIOS

Benjamin Herrenschmidt benh at au1.ibm.com
Wed Jan 2 22:32:03 CET 2013


On Thu, 2013-01-03 at 08:00 +1100, Benjamin Herrenschmidt wrote:
> 
> On ppc64 at least, with a bit of care on the use of global symbols in
> asm, it's fairly easy to generate an position independent executable
> that relocates itself.
> 
> I've written such a relocator myself, it's about 20 lines of C
> (unfortunately it's some internal stuff I cannot post publicly as-is),
> or you can look at the asm variant in Linux written by paulus. The
> idea
> is that you can get the compiler to generate really only one type of
> relocs (R_PPC64_RELATIVE) which are easy to process.
> 
> I assume ppc32 should be similarly easy. I don't know about sparc
> however.
> 
> If you can do the relocation from qemu it's even easier.

Reading the original question, a relocator doesn't seem necessary, I'll
reply separately to it.

Cheers,
Ben.





More information about the OpenBIOS mailing list