Even though this is very common code generation, we don't reflect it in the ABI (Coding Examples, Position-Dependent Code and Position-Independent Code).
extern int x;
int foo ( ) { return x; }
.section ".toc","aw"
.align 3
.LC0:
.quad x
.section ".text"
.align 2
.p2align 4,,15
.globl foo
.type foo, @function
foo:
addis 2,12,.TOC.-foo@ha
addi 2,2,.TOC.-foo@l
.localentry foo,.-foo
addis 9,2,.LC0@toc@ha
ld 9,.LC0@toc@l(9)
lwa 3,0(9)
blr
Even though this is very common code generation, we don't reflect it in the ABI (Coding Examples, Position-Dependent Code and Position-Independent Code).