开发者

Store Local And Global Variable in linux?

Where are the local variables and global variables stored in linux ? What is the difference between开发者_运维知识库 kernel stack and code stack in linux ?

Thank you


Pretty much every modern Linux distro uses address space layout randomisation today, so it is hard to tell where the stack or the heap or the data sections will land.

But in general, globals would go into the data or bss segment, depending on whether they're initialized, and local variables would go into the stack.

As for kernel stack, it's a 8kb fixed size stack that you cannot use directly. It's used within system calls and interrupts. Best forget about it, because it's not really of any use to you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜