]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/test-cases/lto-live_support_section/foo.c
ld64-305.tar.gz
[apple/ld64.git] / unit-tests / test-cases / lto-live_support_section / foo.c
1
2 int my_global = 0;
3
4 __attribute__ ((section ("__DATA,__asan_globals,regular")))
5 struct { void *ptr; } global_metadata = { .ptr = &my_global };
6
7 __attribute__ ((used, section ("__DATA,__asan_liveness,regular,live_support")))
8 struct { void *a, *b; } liveness_binder = { .a = &global_metadata, .b = &my_global };
9
10 int unused_global = 0;
11
12 __attribute__ ((section ("__DATA,__asan_globals,regular")))
13 struct { void *ptr; } unused_global_metadata = { .ptr = &unused_global };
14
15 __attribute__ ((used, section ("__DATA,__asan_liveness,regular,live_support")))
16 struct { void *a, *b; } unused_liveness_binder = { .a = &unused_global_metadata, .b = &unused_global };
17
18
19 int main(int argc, char *argv[])
20 {
21 return my_global;
22 }