Debian Codegraph @

testdata/linked2.c

raw symbols SCIP
1 #include "common.h"
2 #include "linked.h"
3
4 // Weak in L1, strong in L2.
5 __section(".maps") struct h32_btf map_l1_w;
6
7 // Strong in L1, weak in L2.
8 __weak __section(".maps") struct h32_btf map_l1_s;
9
10 // Weak in both L1 and L2.
11 __weak __section(".maps") struct h32_btf map_ww;
12
13 // Strong in L2, only defined here.
14 __section(".maps") struct h32_btf map_l2;
15
16 // Strong in L1, weak in L2.
17 __weak __section("maps") struct bpf_map_def map_legacy_l1_s = h32_legacy(__LINE__);
18
19 // Weak in L1, strong in L2.
20 __section("maps") struct bpf_map_def map_legacy_l2_s = h32_legacy(1);
21
22 // Call external symbol only defined in L1.
23 extern int l1(void);
24 __section("socket") int entry_l1() {
25 return l1();
26 }
27
28 // Weak and only defined in L2, called extern in L1.
29 __weak __noinline int l2() {
30 return 0;
31 }
32
33 // Weak in L1, strong in L2.
34 __noinline int l1_w() {
35 return 0;
36 }
37 __section("socket") int entry_l1_w() {
38 return l1_w();
39 }
40
41 // Strong in L1, weak in L2.
42 __weak __noinline int l1_s() {
43 return __LINE__;
44 }
45 __weak __section("socket") int entry_l1_s() {
46 return l1_s();
47 }
48
49 // Weak in both L1 and L2.
50 __weak __noinline int ww() {
51 return __LINE__;
52 }
53 __weak __section("socket") int entry_ww() {
54 return ww();
55 }