[PATCH] D39079: New clang option -fno-plt to avoid PLT for external calls
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 23 13:56:41 PDT 2017
rnk added a comment.
In https://reviews.llvm.org/D39079#904050, @lebedev.ri wrote:
> No tests?
+1, there should be an -emit-llvm test in clang/test/CodeGen/.
================
Comment at: lib/CodeGen/CGCall.cpp:1859
+ if (auto *Fn = dyn_cast<FunctionDecl>(TargetDecl)) {
+ if (!Fn->isDefined() && !AttrOnCallSite) {
+ FuncAttrs.addAttribute(llvm::Attribute::NonLazyBind);
----------------
Remind me what happens when the definition is within the current DSO after linking. I seem to recall that the call through memory is 6 bytes and the direct pcrel call is 5 bytes, and the linker is required to know to rewrite the indirect call to a nop. Is that accurate?
https://reviews.llvm.org/D39079
More information about the cfe-commits
mailing list