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

Joerg Sonnenberger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 11:31:32 PDT 2017

joerg added a comment.

In https://reviews.llvm.org/D39079#905468, @rnk wrote:

> In https://reviews.llvm.org/D39079#905454, @joerg wrote:
> > It also increases the pressure on the branch predictor, so it is not really black and white.
> I don't understand this objection. I'm assuming that the PLT stub is an indirect jump through the PLTGOT,
>  not a hotpatched stub that jumps directly to the definition chosen by the loader. This is the ELF model
>  that I'm familiar with, especially since calls to code more than 2GB away generally need to be indirect anyway.

Correct, so all local calls to the same function go via the same location and share the predication of the indirect jump.

>> Qt5 tries that. Requires further hacks as the main binary must be compiled as fully position independent code to not run into fun latter. Fun with copy relocations is only part of it.
> I'm not sure I understand, but this patch isn't introducing copy relocations, to be clear.

That was in reference to using it for clang.


More information about the cfe-commits mailing list