| 1 |
|
| 2 |
# Crate Features |
| 3 |
|
| 4 |
| Cargo feature | Description | |
| 5 |
| --- | --- | |
| 6 |
| `proc_macro` | Crate feature `proc_macro` (enables the `#[section]` attribute shim). | |
| 7 |
|
| 8 |
# Macro Attributes |
| 9 |
|
| 10 |
<table><tr><th>Attribute</th><th>Description</th></tr> |
| 11 |
<tr><td><code>aux(main = path::to::MAIN_SECTION)</code></td><td> |
| 12 |
|
| 13 |
Auxiliary sections are stored in a section near the main section. The |
| 14 |
aux path must be a valid reference to the main section. |
| 15 |
|
| 16 |
|
| 17 |
</td></tr> |
| 18 |
<tr><td><code>crate_path = ::path::to::link_section</code></td><td> |
| 19 |
|
| 20 |
The path to the `link-section` crate containing the support macros. If |
| 21 |
you re-export `link-section` items as part of your crate, you can use |
| 22 |
this to redirect the macro's output to the correct crate. |
| 23 |
|
| 24 |
Using the declarative [`section!`][s] form is |
| 25 |
preferred over this parameter. |
| 26 |
|
| 27 |
[s]: crate::declarative::section! |
| 28 |
|
| 29 |
|
| 30 |
</td></tr> |
| 31 |
<tr><td><code>name = my_crate::SECTION_NAME</code></td><td> |
| 32 |
|
| 33 |
Specify a custom section name to allow the section to be used without a |
| 34 |
direct reference. If not specified, the section name will be generated |
| 35 |
using the item name and a path to the section. |
| 36 |
|
| 37 |
It is valid to specify multiple sections with the same name, and the linker |
| 38 |
will ensure that both sections contain the same items. The multiple sections |
| 39 |
must contain the same type, otherwise the section will `panic!` at runtime. |
| 40 |
|
| 41 |
While `name` accepts a path, this path does not refer to a specific Rust |
| 42 |
item path. |
| 43 |
|
| 44 |
|
| 45 |
</td></tr> |
| 46 |
<tr><td><code>untyped | typed | mutable | movable | reference</code></td><td> |
| 47 |
|
| 48 |
The type of the section. |
| 49 |
|
| 50 |
|
| 51 |
</td></tr> |
| 52 |
<tr><td><code>unsafe</code></td><td> |
| 53 |
|
| 54 |
Allow the section to be used without a direct reference. |
| 55 |
|
| 56 |
|
| 57 |
</td></tr> |
| 58 |
</table> |
| 59 |
|
| 60 |
# Defaults |