When compiling with -fpic, in contrast to -fPIC, use only the immediate field to index into the GOT. This saves space if the GOT is known to be small. The linker will warn if the GOT is too large for this method.
It doesn't look like we can parse the textual asm produced by this. E.g.:
ld [%i0+x], %i0 .common x,4,4
Then running llvm-mc -filetype=obj -position-independent -triple sparc -o test.o test.s hits an assert in SparcMCCodeEmitter::getMachineOpValue at SparcMCCodeEmitter.cpp:152, because it got parsed as a <MCOperand Expr:(x)>, not as a SparcMCExpr with the VK_SPARC_GOT13 kind, as it should.
Same failure, actually, without the -position-independent, too, actually, should've parsed as VK_SPARC_13. But at least we don't ever actually generate that on output.
|61 ↗||(On Diff #147770)|
Strange that this doesn't print %got13. But, checking with gcc and gnu as, they don't support it. So, great, more magic just like %got22, %got10, %pc22, and %pc10.