aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-ifunc/ifunc-lib.c
blob: 13ca25065a9f41cb6c1a7ab5c611299f369c460e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
static int
one (void)
{
  return 1;
}

static int
minus_one (void)
{
  return -1;
}

void * foo_ifunc (void) __asm__ ("foo");
__asm__(".type foo, %gnu_indirect_function");

void *
foo_ifunc (void)
{
  return one;
}

void * bar_ifunc (void) __asm__ ("bar");
__asm__(".type bar, %gnu_indirect_function");

void *
bar_ifunc (void)
{
  return minus_one;
}