[PPC32] Support PLT calls for -msecure-plt -fpic
authorFangrui Song <maskray@google.com>
Tue, 25 Jun 2019 15:56:32 +0000 (15:56 +0000)
committerFangrui Song <maskray@google.com>
Tue, 25 Jun 2019 15:56:32 +0000 (15:56 +0000)
commit4284cfd2919619ea03de83f412d3260b2a516f9d
tree869f0a176cdfb01732b795d053f018e463b95b77
parentb0917b06be3b09f5693c139ae36cc55ade28f209
[PPC32] Support PLT calls for -msecure-plt -fpic

Summary:
In Secure PLT ABI, -fpic is similar to -fPIC. The differences are that:

* -fpic stores the address of _GLOBAL_OFFSET_TABLE_ in r30, while -fPIC stores .got2+0x8000.
* -fpic uses an addend of 0 for R_PPC_PLTREL24, while -fPIC uses 0x8000.

Reviewers: hfinkel, jhibbits, joerg, nemanjai, spetrovic

Reviewed By: jhibbits

Subscribers: adalava, kbarton, jsji, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364324 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCMCInstLower.cpp
test/CodeGen/PowerPC/ppc32-pic.ll
test/CodeGen/PowerPC/ppc32-secure-plt-tls2.ll [new file with mode: 0644]