build: improve linker script and target settings #21
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.
This change is a few small fixes to
target.json
andlayout.ld
layout.ld
layout.ld
, we shouldn't also be setting them in a second place.panic = "abort"
target.json
,cargo check
andcargo clippy
will break when building for the host target..bss
into.data
.bss
section normally represents "uninitialized/zero" data that will later be written by the program. Generally this means it has a runtime memory area, but no corresponding data in the output binary. The program header just says where to load it..bss
section in.data
. This now puts explicitly zeroed data in.data
instead of relying on the loader to "expand" the.bss
data at runtime.ld.ldd
(unlike the gnutoolsld
) just directly zeros the.bss
region in the file. However, this isn't a stable behavior to rely on.target.json
relocation-mode
option.code-model
anddynamic-linking-available
to make our linking assumptions clear.Signed-off-by: Joe Richey [email protected]