This patch supports secure plt mode for TLS symbols, it's extension for https://reviews.llvm.org/D42112.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I think overall, it would be good to explain the semantics of this patch. Maybe even provide a reference to a document that explains it if it isn't something that can be summarized into a comment in the review (or a comment in the code).
Also, I imagine you'll want to add some code to getGlobalBaseReg() to disable shrink-wrapping since you're adding a clobber of the LR without introducing any frame references, so shrink-wrapping may move the prologue out of the entry.
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp | ||
---|---|---|
445–453 | Nit: naming convention - variables start with an upper case letter. I realize it was that way, but since you're changing its type, might as well change its name. | |
lib/Target/PowerPC/PPCISelDAGToDAG.cpp | ||
4011 | A comment explaining why this is needed would be great. | |
4012 | I think it's pertinent to add a comment to calls like this one outlining why the virtual SDNode returned by this function does not need to have a use and it still won't end up being DCE'd. | |
test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll | ||
14 | I imagine there's supposed to be code up here that sets up the base pointer. Do we not want to check for that code? |
Regarding secure plt in general I was using this document: http://devpit.org/wiki/Debugging_PowerPC_ELF_Binaries. This patch just expands secure-plt support for TLS symbols, basically the same thing as for functions symbols or global symbols in the last patch.
Also as a reference I'm using gcc.
I haven't run into example that fails because of shrink-wrapping. If this is a potential issue would not it have appeared so far, since
getGlobalBaseReg() is existing function and it was used before secure-plt support? Do you have some test case that potentially can reproduce issue related with shrink-wrapping?
test/CodeGen/PowerPC/ppc32-secure-plt-tls.ll | ||
---|---|---|
14 | These 3 instructions (mflr,addis,addi) are setting up the base pointer. There is one more instruction in this sequence that I forgot to check (bl). I have added it in updated patch. |
LGTM
lib/Target/PowerPC/PPCAsmPrinter.cpp | ||
---|---|---|
493 | Can you please reference a document and a section number, or similar? |
lib/Target/PowerPC/PPCAsmPrinter.cpp | ||
---|---|---|
493 | I was referencing on source from binutils tools and gcc. Is that OK with you ? |
Nit: naming convention - variables start with an upper case letter. I realize it was that way, but since you're changing its type, might as well change its name.