In an assembly program, the .text
section is loaded at 0x08048000
; the .data
and the .bss
section comes after that.
What would happen if I don't put an exit
syscall in the .text
section? Would it lead to the .data
and the .bss
section being interpreted as code causing "unpredictable" behavior? When will the program terminate -- probably after every "instruction" is executed?
I can easily write a program without the exit
syscall, but testing if .data
and .bss
gets executed is something I don't know because I guess I would have to know the real machine code that is generated under-the-hoods to understand that.
I think this question is more about "How would OS and CPU handle such a scenario?" than assembly language, but it is still interesting to know for assembly programmers etc.