I am new to embedded systems low-level programming and I am quite confused what happens exactly after the linker generate an output object file and during flashing the .bin file.
1- I see in the linker script that the loadable memory address(LMA) and virtual memory address(VMA) of a .bss section is in RAM, my question is how does it initially go to RAM since I flash my binary image in FLASH memory?
2- The start up codes I saw only zero out the .bss section in RAM, but how did it even get there if the start-up code didn't copy it to RAM as it does with the .data section ?
.bss
and which initial value they have. Not clear what your problem is. – too honest for this site.bss
section is not part of the.data
section* in gcc, but a seperateNOLOAD
section! Check your linker control file, read the ld-documentation. A segment is a different thing. "No it does not" - I cited the wrong assumption, not clear what you don't understand, but maybe you follow my advice and read the standard. Hint: Objects going into.bss
for implementations which support it are initialised! In fact, you stated that yourself already. Well-meant: Sometimes it is a good thing to step back to see the whole picture. If you are too close you only see coloured dots. – too honest for this site