Displaying 1 result from an estimated 1 matches for "foo_resolve".
2020 Aug 10
3
resolve the name of an ifunc resolver function
...);
Constant *r = IF.getResolver();
But how do I get to the (Function*) or function name of the resolver
from there? I tried everything with the Constant which seems to be a
ConstantExpr type ... ....
Example test program below:
#include <stdio.h>
int foo(void) __attribute__((ifunc("foo_resolve")));
static int global = 1;
static int foo1(void) { return 0; }
static int foo2(void) { return 1; }
void *foo_resolve(void) { return global == 1 ? foo1 : foo2; }
int main() { printf("%d\n", foo()); }
Thank you!
Regards,
Marc