Link_section not adding section in release

Making the section name start with .note. in combination with #[no_mangle] (or #[used] for statics) seems to work too. Note sections are never allocated though, so you need to make sure that the symbol is not referenced at runtime. You can only read it directly from the linked executable file.

3 Likes