[PATCH] D39079: New clang option -fno-plt to avoid PLT for external calls

Sriraman Tallam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 15:38:43 PDT 2017

tmsriram added inline comments.

Comment at: lib/CodeGen/CGCall.cpp:1859
+    if (auto *Fn = dyn_cast<FunctionDecl>(TargetDecl)) {
+      if (!Fn->isDefined() && !AttrOnCallSite) {
+        FuncAttrs.addAttribute(llvm::Attribute::NonLazyBind);
rnk wrote:
> 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?
That's accurate, the linker rewrites it with a nop equivalent.


More information about the cfe-commits mailing list