Quote:
Originally Posted by
naresh046
It is in text segment ... If you want you can check it... like this..
Try to change the value of that variable..
Sorry, that's wrong -- or at least not strictly correct. In my system, it ends up in the
.rodata section, which is read-only despite not being the
text section.
The
text section doesn't actually mean text as in words -- it means
program text, i.e. machine language. It's read-only since it usually maps directly into object files. It's not inconceivable for variables to end up there, but still a funny place to put them.
The
data segment would make more sense, being where global variables go, but has the drawback of not being read-only.
So, for systems that don't have any sort of read-only data section available, I guess the text section might be as good a place as any. And if you
can write to it, it's probably inside the data segment...