aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-size/size-5b.c
blob: a9450a5c868ee4861ee7f053a51a6d6fa911e2aa (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
30
31
32
33
34
35
36
37
extern __thread char bar[];
extern char size_of_bar asm ("bar@SIZE");

char *bar_size_1 = &size_of_bar;
static char *bar_size_2 = &size_of_bar;

char *
bar_size1 (void)
{
  bar[2] = 3;
  return bar_size_1;
}

char *
bar_size2 (void)
{
  return bar_size_2;
}

extern __thread char foo[];
extern char size_of_foo asm ("foo@SIZE");

char *foo_size_1 = &size_of_foo;
static char *foo_size_2 = &size_of_foo;

char *
foo_size1 (void)
{
  foo[3] = 4;
  return foo_size_1;
}

char *
foo_size2 (void)
{
  return foo_size_2;
}