-
Notifications
You must be signed in to change notification settings - Fork 76
ELF output contains lots of zero data: linker script issue? #60
Comments
FWIW this is on K210 and all memory regions are simply aliased to SRAM, sections are not treated any differently there:
|
To be honest, I'm not good at writing linker scripts and almost sure we can do better. However, I have no idea how to achieve this. The output you see is probably due to the Lines 159 to 161 in 2d05df6
|
Pretty sure that that should work. I looked into it a bit yesterday (even as far as looking into the So I'm starting to think it could be some Separately from this, we could consider making the section only as big as needed instead of cover all of memory. Make it start AT( |
This seems to be a known (and fixed) issue: rust-lang/rust#73201 |
It could be that something is going wrong with the linker script. A binary of a small example is almost 7 MB in size:
Using
size
, this seems to be allocated to data sections:Digigng further:
It seems the stack section is in the binary, padded fully with zeros:
I'm not sure why this is not treated like the
.bss
section, implicitly implied to be filled with zeros (the section is correctly labeledNOLOAD
, but are not generated with ELF section typeSHT_NOBITS
).The text was updated successfully, but these errors were encountered: