I have a static string that I would like to show up in my binary's symbol table. I have marked it with #[no_mangle] and use it in one location, but it doesn't show up in the symbol table. I can confirm that it is being included by running strings <binary> | grep "<contents of static>".
If I instead don't use it in my own code and just mark it with #[used] then it does show up in the symbol table. This leads me to assume that the static is being promoted to a const and effectively inlined. If this is correct, how can I prevent it from being promoted or optimized out?