[PowerPC] Support for R_PPC64_REL24_NOTOC calls where the caller has no TOC and the...
authorVictor Huang <wei.huang@ibm.com>
Wed, 29 Jul 2020 18:38:55 +0000 (18:38 +0000)
committerVictor Huang <wei.huang@ibm.com>
Wed, 29 Jul 2020 19:49:28 +0000 (19:49 +0000)
commit8dbea4785c107aa975b6671025a3cea7829b8370
tree328625e4233ada9602f023ed5df074627a7feb56
parenta1c9529e602adcc25162f93fd4563fbe3d04ab62
[PowerPC] Support for R_PPC64_REL24_NOTOC calls where the caller has no TOC and the callee is not DSO local

This patch supports the situation where caller does not have a valid TOC and
calls using the R_PPC64_REL24_NOTOC relocation and the callee is not DSO local.
In this case the call cannot be made directly since the callee may or may not
require a valid TOC pointer. As a result this situation require a PC-relative
plt stub to set up r12.

Reviewed By: sfertile, MaskRay, stefanp

Differential Revision: https://reviews.llvm.org/D83669
lld/ELF/Arch/PPC64.cpp
lld/ELF/Thunks.cpp
lld/test/ELF/ppc64-pcrel-call-to-extern.s [new file with mode: 0644]
llvm/include/llvm/Object/ELF.h