Initialize data and bss sections in assmebly #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The embedonomicon currently suggests to initialize the bss and data sections in Rust code. However, since this was written, there has been extensive discussion about the soundness of the runtime initialization code.
In particular, the following questions have been raised:
_sbss
and_ebss
) can be compared. Note that the code in embedonomicon does not suffer from this issue, since pointers are converted tousize
values such that provenance does no longer apply by the time they are subtracted to determine the region size. This was not the case in multiple runtime crates.The general consensus in the ecosystem has been to move away from performing the initialization of the static memory regions in Rust. In order to avoid creating a false sense of security while reading the embedonomicon, these issues should be mentioned in the book, and the code written in assembly to reflect the current best-practice approach to platform initialization code.
References: