ifunc attribute in C++

Alexander Monakov amonakov@ispras.ru
Fri Jan 30 15:16:00 GMT 2015



On Fri, 30 Jan 2015, asomers@gmail.com wrote:

> Does the ifunc attribute work in C++, and if so can somebody please
> show me a working example?  I found several examples that work in C,
> but none in C++.  For example, the below file works fine in C:

Yes, it works in C++; the issue you're hitting is that due to C++ name
mangling, the assembler name of the resolver function (foo_ifunc) is changed,
and no longer matches what you wrote in the attribute.  Perhaps the easiest
fix for that is to put the resolver inside an 'extern "C" { ... }' block.

HTH.
Alexander



More information about the Gcc-help mailing list