]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/test-cases/dead_strip-live-if-ref-live/main.c
ld64-305.tar.gz
[apple/ld64.git] / unit-tests / test-cases / dead_strip-live-if-ref-live / main.c
1 #include <stdio.h>
2
3 int aa = 10;
4 int bb = 20;
5 int cc = 30;
6
7
8 int main()
9 {
10 printf("%p %p\n", &aa, &cc);
11 return 0;
12 }
13
14
15 struct MetaData {
16 void* addr;
17 unsigned long size;
18 const char* name;
19 };
20
21
22 #define META_DATA(__x) \
23 __attribute__((used, section("__DATA,__meta,regular,live_support"))) \
24 static struct MetaData __x##Info = { &__x, sizeof(__x), #__x };
25
26
27 META_DATA(aa);
28 META_DATA(bb);
29 META_DATA(cc);