我可以将可执行文件假设为执行状态的快照映像吗?
我读了一些unix手册(http://pubs.opengroup.org/onlinepubs/009695399 /functions/posix_spawn.html),并且提到了执行。
新的进程映像应由常规可执行文件构建 文件称为新的过程映像文件。
处理图像这个表达引起了我的注意。
我一直认为可执行文件只是一种命令序列。正如程序这个词的含义一样。但实际上,我不知道可执行文件的概念和结构。我觉得可执行文件可能看起来像上面提到的执行状态图像。
你能给我解释一下吗?关于当今常规可执行文件的概念和结构。在任何操作系统中。
I read some unix manual (http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html), and there was a mention about execution.
The new process image shall be constructed from a regular executable
file called the new process image file.
The expression process image caught my eyes.
I have been thought executable file is just a kind of sequence of command. Just as the word program means. But actually, I don't know the concept and structure of the executable file. And I felt executable file could be looks like an execution state image from the mention.
Could you explain me something about this? About the concept and structure of regular executable files in nowadays. In any OS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常可执行文件不仅包含指令,还包含全局数据、只读数据等等。我建议您简单地看一下例如在类 UNIX 操作系统中广泛使用的 ELF 格式 或 Windows 中使用的 PE 格式。
例如,操作系统可能还需要将一些函数地址(跳转目标)替换为内存中这些函数的真实地址,尽管这种技术可能不再在常见操作系统中使用。无论如何,除了将文件复制到内存并从第一个字节开始执行之外,还有更多的工作要做。
Usually the executable file does not contain only instructions but also global data, readonly data and many more. I suggest you briefly look e.g. on the ELF format widely used in UNIX-like operating systems or PE format used in Windows.
The OS may also need for example to replace some addresses of functions (jump targets) with the real addresses of these functions in the memory, although this technique is probably not used anymore in common OSes. Anyway, there can be more work to do than just copy the file into memory and start executing from the first byte.