A General-dynamic tls access can be written using a R_PPC64_TLSGD16 relocation if the target got entry is within 16 bits of the TOC-base. This patch adds support for R_PPC64_TLSGD16 by relaxing it the same as a R_PPC64_GOT_TLSGD16_LO, ie rewriting the instruction to an addis 3, 13, a@tprel@ha. The full transformation is:
gd: le:
addi 3,2,a@got@tlsgd --> addis 3, 13, a@tprel@ha bl __tls_get_addr(a@tlsgd) --> nop nop --> addi 3, 3, a@tprel@l
Do not have a strong opinion here.. But do you want to use the short form -r?
--wide -W is actually an ignored option in llvm-readelf.
https://github.com/llvm-mirror/llvm/tree/master/tools/llvm-readobj/llvm-readobj.cpp#L52