[PATCH] [PowerPC] Replace foul hackery with real calls to __tls_get_addr

Justin Hibbits jrh29 at alumni.cwru.edu
Tue Nov 11 07:28:01 PST 2014


>>! In D6209#10, @wschmidt wrote:
>>>! In D6209#5, @jhibbits wrote:
>> Tests for 32-bit are already included, as part of tls-pic.ll.
> 
> Yes, I saw those.  However, what I'm referring to is the use of VK_PLT in the PPCAsmPrinter::EmitInstruction() code, the purpose of which is to ensure that ELF::R_PPC_PLTREL24 is applied to the __tls_get_addr symbol rather than ELF::R_PPC_REL24.  You don't have a relocation test for this.  See test/MC/PowerPC/tls-gd-obj.s for an example of how to do this.

I don't follow.  VK_PLT is a decorator for @PLT, and I already have tests for ensuring @PLT becomes R_PPC_PLTREL24 (ppc-reloc.s).  Isn't a sufficient test for this simply to ensure that @PLT is generated when that code path is followed?  Do you instead expect that the inline assembler will recognize a call to __tls_get_addr() and itself add VK_PLT?  The other relocations for PLT are identical to those of powerpc64 in this case.  Okay, maybe a test to generate R_PPC_GOT_TLSLD/R_PPC_GOT_TLSGD instead of R_PPC_GOT_TLSLD_LO/R_PPC_GOT_TLSGD_LO might be prudent, and I can readily add, but that's not what you requested.

http://reviews.llvm.org/D6209






More information about the llvm-commits mailing list