[PATCH] D71649: [PPC32] Emit R_PPC_PLTREL24 for calls to dso_local ifunc

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 07:44:54 PST 2019


sfertile added a comment.

In terms of making a dso_local ifunc work this behavior seems logical to me: I'm skeptical though because I'm not sure we typically **know** when we are calling an ifunc.
>From the gcc  docs on ifunc attribute <https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes>

> The exported header file declaring the function the user calls would contain:
>  `extern void *memcpy (void *, const void *, size_t);`
>  allowing the user to call memcpy as a regular function, unaware of the actual implementation

Maybe non-preemptable ifuncs are different in that they must be declared as ifuncs explicitly before use, but if not I think the compiler/linker/loader need to work in tandem to support calling an ifunc where the call site does not know the implementation is an `STT_IFUNC `as opposed to an `STT_FUNC`. If thats the case, doing something different at the callsite based on if the callee being an ifunc would be the wrong approach to making this work (even though it seems its the approach taken by gcc and ld.bfd).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71649/new/

https://reviews.llvm.org/D71649





More information about the llvm-commits mailing list