To prevent some performance overhead I would like to append some binary data created by openssl to a Rust executable as an ELF section. While the data itself might have a variable length, its actual length may be parse from the header though.
If you're just trying to include the file so your program can read them, you can use include_bytes rather than manually modifying the executable. The compiler will keep track of the number of bytes included.
Apparently I missed to write down the initial idea in form of an example. I would like to work with the [link-section] attribute to access the data that is attached in the custom ELF section similar to this example
#[link_section = ".additional_data"]
static ADDITIONAL_DATA: <special type>;
// do some computing with ADDITIONAL_DATA