I do not understand what the .data section is specifically for?
Is it comparable to wanting to say y = 8? Couldnt you just load an immediate value of 8 into some register which would be the same?
I do not understand what the .data section is specifically for? Is it comparable
Share
It’s for storing, well, ummm, data.
A typical program will have several sections:
.text→ for code (program text).rodata→ for read-only data.data→ for data.bss→ for uninitialized dataC global variables and static local variables go to
.dataor.bss(they get created when loading the program, and get destroyed on program’s end, their lifetime is the entire program execution). C local variables go to the stack (they get created when entering the function, and get destroyed when leaving the function), C storage allocated bymalloc()go to the heap (they get created and destroyed dynamically by the programmer, their lifetime is dynamic).