aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/ifuncvar1.c
blob: 75af2a6a930727e7bc0e34d1c9a31c38b37ecfcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Test global variable initialized to hidden STT_GNU_IFUNC symbol.  */

int didit;

extern void doit (void);

void
doit (void)
{
  didit = 1;
}

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

void (*get_foo (void)) (void)
{
  return &doit;
}