In tests I have run the memory in the bss section of my programs has always been initialized to zero before I write anything there. Is this coincidental, or is the system "cleaning" these memory pages before handing them to me? I am using the nasm assembler on Ubuntu (if that possibly makes a difference).
Your application's executable file(ELF) has a BSS section's size information, when it starts up, kernel allocate a block of memory for BSS section, and clean it to 0. This defined by ABI(Application Binary Interface), so you needn't worry about there are different on different machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With