I thought we might be missing some ELF sections in the linker script but my tries based on `powerpc64-linux-gnu-ld --verbose` were unsuccessful. Is there a way to turn on warnings for sections dropped, to rule this out?
ld -M will show you everything you ever wanted to know, and much more. readelf -Wa is useful for many problems as well.
Who's responsible for r2 setup - GCC-generated code or QEMU?
r2 contains the GOT IIRC. But for ABI questions, it's probably best to consult Segher :). Unless I'm completely mistaken, usually the loader initializes r2, so in this case the asm code needs to set it up properly.
Depends what you call "loader". Usually your crt1 equivalent sets GPR2. It is probably a good idea to set it in all exception handlers as well (if they want to call C code, or need it otherwise).
Segher