On Wed, Apr 3, 2024 at 8:32 AM Peter Bergner <berg...@linux.ibm.com> wrote: > > On 4/3/24 7:40 AM, H.J. Lu wrote: > > We can't profile indirect calls to IFUNC resolvers nor their callees as > > it requires TLS which hasn't been set up yet when the dynamic linker is > > resolving IFUNC symbols. > > > > Add an IFUNC resolver caller marker to cgraph_node and set it if the > > function is called by an IFUNC resolver. Disable indirect call profiling > > for IFUNC resolvers and their callees. > > The IFUNC resolvers on Power do not use TLS, so isn't this a little too > conservative? Should this be triggered via a target hook so architectures > that don't use TLS in their IFUNC resolvers could still profile them?
I think you misunderstood the patch/situtation. Most ifunc resolves don't use TLS at all; what is happening here is that the profiler (-fprofile-generate) is adding TLS usage to the ifunc resolver which then causes issues. And the use of TLS causes a PLT call to be inside the ifun which causes all the fun stuff. This is not about ifunc resolves using TLS directly in code but rather indirectly via -fprofile-generate. Thanks, Andrew Pinski > > Peter > >