[PATCH] D38554: Fixed ppc32 function relocations in non-pic mode

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 17:03:58 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D38554#903690, @vit9696 wrote:

> So, am I right that the correct approach is to add an additional check whether eabi target is used?
>  Another way is to ensure that lld handles PLT relocations and solves them as relative relocations if possible.
>  I think that both changes should be made regardless of the reasons behind, but I would like to hear the opinion of @ruiu and @davide from lld project first.
>
> TL;DR latest llvm completely breaks compatibility with lld for ppc32 target, and even a simple program won't be linked due to unsupported PLT relocations llvm emits. I could submit a patch solving PLTREL relocations for local symbols, however, adding full PLT support to lld will require more effort than I could spend on this issue.


As we've stated, lld support on PPC is not mature enough to motivate features in this sense. Regardless, let me propose the following:

https://reviews.llvm.org/D39079 is going to add support for GCC's -fno-plt option (the nolazybind attribute will be added to functions compiled when -fno-plt is specified). We can add PPC support for this attribute. In this way, by specifying -fno-plt, we'll have a way to directly request the desired code-generation strategy. You can look at https://reviews.llvm.org/D39065 for an example of how to use the attribute (you'll essentially add a check for `F->hasFnAttribute(Attribute::NonLazyBind)`.


https://reviews.llvm.org/D38554





More information about the llvm-commits mailing list