I’m looking at doing some embedded work with Rust as a test to see how it would fit for some projects. One of the things I would like to do is emulate something I do with GCC and C right now with the weak attribute. It’s defined like this (which you probably know):
The weak attribute causes the declaration to be emitted as a weak symbol rather than a global. This is primarily useful in defining library functions which can be overridden in user code, though it can also be used with non-function declarations. Weak symbols are supported for ELF targets, and also for a.out targets when using the GNU assembler and linker.
Is it possible to do something similar to this with Rust? I’ve tried searching as best as I could, but couldn’t find anything that really answered my question.