简体   繁体   English

.o Object 文件是什么格式?

[英]What is the format of .o Object Files?

I've been learning low-level stuff for a while now and I'm quite familiar with PE files and how they work.我学习底层的东西已经有一段时间了,我对 PE 文件及其工作方式非常熟悉。 But I've been unable to find any documentation of their precursor .o files.但我一直无法找到他们的前身.o文件的任何文档。 I'm looking for a deep-dive on the actual byte-by-byte structure of them.我正在寻找对它们的实际逐字节结构的深入研究。

What does the format of .o files depend on? .o文件的格式取决于什么? Is it even platform specific at all?它甚至是特定于平台的吗? Perhaps compiler-specific?也许特定于编译器? Where can I find documentation on the file format of .o files?在哪里可以找到有关.o文件的文件格式的文档? Mostly interested in Windows.最感兴趣的是 Windows。

.o files as produced by GCC and LLVM when using Windows (MinGW) are COFF files (see https://wiki.osdev.org/COFF ). GCC 和 LLVM 在使用 Windows (MinGW) 时生成的.o文件是 COFF 文件(参见https://wiki.osdev.org/COFF )。 On certain other platforms the ELF format is used.在某些其他平台上,使用 ELF 格式。

The Windows PE format (used for .dll and .exe files) is actualy a subset of the COFF format. Windows PE 格式(用于.dll.exe文件)实际上是 COFF 格式的子集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM