Windows 可执行文件结构
我知道通常目标文件有代码、数据、堆和堆栈部分。
但我想知道这是如何在 Windows 可执行文件和 Linux 可执行文件中安排的。
我在互联网上搜索并找到了一些结构。
我理解 .text 用于代码,.data 用于全局变量。
我想知道这里的栈和堆在Linux和Windows平台上都是一样的吗?
谁能告诉我可执行文件的结构?
提前致谢...
I know that generally the object file has code, data, heap and stack sections.
But I want to know how this is arranged in windows executables and Linux executables.
I searched on internet and found some structure.
I understood .text is for code and .data is for global variables.
I want to know here is the stack and heap in both Linux and Windows platform?
Can anybody tell me the executable file structures??
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Microsoft 发布的规范:
http://msdn.microsoft.com/ en-us/windows/hardware/gg463119
这也是关于该主题的很好的读物:
http://msdn.microsoft.com/en-us/magazine/cc301805.aspx编辑
:
堆栈/堆是在运行时创建/修改的内存中结构,因此本质上它们不在文件本身中 - 它们不能在文件本身中。将它们视为内存中的一个特殊位置,每个程序都可以在其中存储运行时数据,我所说的运行时数据指的是变量。函数调用、返回值以及所有在底层发生的实际内容。
This is the specification that Microsoft has released:
http://msdn.microsoft.com/en-us/windows/hardware/gg463119
Also this is a good reading on the subject:
http://msdn.microsoft.com/en-us/magazine/cc301805.aspx
EDIT:
Stack/Heap are in-memory structures which are created/modified during run-time so in essence they are not in the file itself - they can't be. Think of them as a special place in memory where each and every program can store run-time data and by run-time data I mean variables. function invocations, return values and all the nitty-gritty stuff that are hapening on the low level.