aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-gc/pr19161-2.c
blob: b51f31a54209240d91380fac82bb445726330ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
int __attribute__((section("my_section"))) a[2] = {0x1234, 0x5678};

extern int __start_my_section;

extern int (*p)(void);

int
dump()
{
   int* ap = &__start_my_section;
   return ap[0];
}

void 
__attribute__((constructor))
foo()
{
  p = dump;
}