[PATCH] D70570: [PowerPC] Only use PLT annotations if using PIC relocation model
Justin Hibbits via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 10 10:37:28 PST 2019
jhibbits added a comment.
@Bdragon28 we might need to use -mlongcall for modules, if we aren't already. This should(?) force the compiler to generate the appropriate long-distance code sequences. I'm not sure, though, if clang supports this yet.
@sfertile Thanks for reviewing this. That ABI spec has been superseded generally by https://www.polyomino.org.uk/publications/2011/Power-Arch-32-bit-ABI-supp-1.0-Unified.pdf, which unifies that with the Linux ABI(s) and embedded ABI(s). That also includes the secure-PLT reference.
Your overall understanding of the relocations involved and code generated is accurate. To answer your questions:
- Newer linkers (GNU ld post-2.17.50) might be smart enough to convert to a local call. However, GNU ld uses PLTREL relocations without the +0x8000 offset as an indicator of "BSS-PLT" in its heuristics. This is what led to this change.
- It is an error to not use a PLTREL relocation for a call that needs to be indirected through the PLT. The linker will complain to recompile with -fPIC.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70570/new/
https://reviews.llvm.org/D70570
More information about the llvm-commits
mailing list