Rust equivalent to __attribute__((section(NAME), used))?


Does Rust has a way to specify where to place the binary in the section of compiled elf binary? Like attribute((section(NAME), used)) in C? One usage is: For example, the code that uses this would be like:


Yes, you need the link_section attribute and the used attribute. At least one or both of these require nightly if I remember correctly.