linkme_impl/
linker.rs

1pub mod linux {
2    use syn::Ident;
3
4    pub fn section(ident: &Ident) -> String {
5        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("linkme_{0}", ident))
    })format!("linkme_{}", ident)
6    }
7
8    pub fn section_start(ident: &Ident) -> String {
9        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__start_linkme_{0}", ident))
    })format!("__start_linkme_{}", ident)
10    }
11
12    pub fn section_stop(ident: &Ident) -> String {
13        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__stop_linkme_{0}", ident))
    })format!("__stop_linkme_{}", ident)
14    }
15}
16
17pub mod bsd {
18    use syn::Ident;
19
20    pub fn section(ident: &Ident) -> String {
21        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("linkme_{0}", ident))
    })format!("linkme_{}", ident)
22    }
23
24    pub fn section_start(ident: &Ident) -> String {
25        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__start_linkme_{0}", ident))
    })format!("__start_linkme_{}", ident)
26    }
27
28    pub fn section_stop(ident: &Ident) -> String {
29        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__stop_linkme_{0}", ident))
    })format!("__stop_linkme_{}", ident)
30    }
31}
32
33pub mod macho {
34    use syn::Ident;
35
36    pub fn section(ident: &Ident) -> String {
37        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__DATA,__linkme{0},regular,no_dead_strip",
                crate::hash(ident)))
    })format!(
38            "__DATA,__linkme{},regular,no_dead_strip",
39            crate::hash(ident),
40        )
41    }
42
43    pub fn section_start(ident: &Ident) -> String {
44        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("\u{1}section$start$__DATA$__linkme{0}",
                crate::hash(ident)))
    })format!("\x01section$start$__DATA$__linkme{}", crate::hash(ident))
45    }
46
47    pub fn section_stop(ident: &Ident) -> String {
48        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("\u{1}section$end$__DATA$__linkme{0}",
                crate::hash(ident)))
    })format!("\x01section$end$__DATA$__linkme{}", crate::hash(ident))
49    }
50}
51
52pub mod windows {
53    use syn::Ident;
54
55    pub fn section(ident: &Ident) -> String {
56        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!(".linkme_{0}$b", ident))
    })format!(".linkme_{}$b", ident)
57    }
58
59    pub fn section_start(ident: &Ident) -> String {
60        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!(".linkme_{0}$a", ident))
    })format!(".linkme_{}$a", ident)
61    }
62
63    pub fn section_stop(ident: &Ident) -> String {
64        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!(".linkme_{0}$c", ident))
    })format!(".linkme_{}$c", ident)
65    }
66}
67
68pub mod illumos {
69    use syn::Ident;
70
71    pub fn section(ident: &Ident) -> String {
72        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("set_linkme_{0}", ident))
    })format!("set_linkme_{}", ident)
73    }
74
75    pub fn section_start(ident: &Ident) -> String {
76        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__start_set_linkme_{0}", ident))
    })format!("__start_set_linkme_{}", ident)
77    }
78
79    pub fn section_stop(ident: &Ident) -> String {
80        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("__stop_set_linkme_{0}", ident))
    })format!("__stop_set_linkme_{}", ident)
81    }
82}