aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-ifunc/pr18841b.c
blob: 1e87469c5f9b9d01492d633f4f4e3bcffb678f1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void foo() __attribute__((ifunc("resolve_foo")));

static void foo_impl() {}

extern void abort (void);
void test()
{
  void (*pg)(void) = foo;
  if (pg != foo_impl)
    abort ();
  pg();
}

static void* resolve_foo()
{
  extern void zoo(void);

  void (*pz)(void) = zoo;
  pz();
  return foo_impl;
}