Retro68/binutils/ld/testsuite/ld-ifunc/pr18808b.c

27 lines
299 B
C
Raw Normal View History

int foo (int) __attribute__ ((ifunc ("resolve_foo")));
2017-04-10 11:32:00 +00:00
extern void abort (void);
static int
foo_impl (int x)
2017-04-10 11:32:00 +00:00
{
return x;
}
void
bar (void)
2017-04-10 11:32:00 +00:00
{
int (*f)(int) = foo;
if (foo (5) != 5)
abort ();
if (f (42) != 42)
2017-04-10 11:32:00 +00:00
abort ();
}
void *
resolve_foo (void)
2017-04-10 11:32:00 +00:00
{
return (void *) foo_impl;
}