Main Page | See live article | Alphabetical index

COFF

The Common Object File Format (COFF) is an object file format that was introduced in Unix System V Release 3, and was later adopted by Microsoft for Windows NT. It was superseded by the more powerful ELF in System V Release 4, but as of 2003 COFF is still used in Windows.

The original Unix object file format a.out is a very simple design, and was too limited to effectively handle the additions of SVR3, such as shared libraries. Also, a.out does not define a symbolic debug data format; stabs works by encoding debug info into special symbols in the symbol table.

COFF's main improvement was the introduction of multiple named sections in the object file. Different object files could have different numbers and types of sections. In addition, a debug data format was defined.

However, the COFF design soon turned out to be too limited; there was a limit on the maximum number of sections, a limit on the length of section names, and so forth. In addition, the debug info was really only capable of supporting C debugging; for instance, C++ had additional constructs that had no way to be represented, and the debug info was designed to be extensible. IBM solved this in AIX with the XCOFF format, MIPS and others used ECOFF, and GNU tools adopted the workaround of encoding stabs info, which was extensible, into special COFF sections in a technique known as stabs-in-coff.