How to Resolve Linker Script Variables in Rust code?

In C code one can reference a variable that is defined externally in a linker script and it is happily resolved by the linker at that stage of the build. For example, in some C boot code the linker script is used to calculate the size of a flash memory section (_flashsize) based on the subsections defined in the script, which is typical of linker scripts. The C boot code defines "extern _flashsize" and uses it as necessary and the build suceeds

In Rust however there appears to be no way to tell the compiler to let the resolution be handled by the linker and the build quits in the compiler.

Is there a way of allowing this behavior a Rust version of the boot code?

Thanks for any suggestions.

Bob Stewart

https://stackoverflow.com/questions/45550387/how-can-i-access-a-c-global-variable-constant-in-rust-ffi

Thanks. That helps me.

Bob

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.