Program, library and object file formats

Compiled machine code. A compiler turns each source file into an object file, with gaps left for the addresses of things defined elsewhere; a linker joins object files and libraries, fills the gaps and writes a program or library that the operating system loads and runs. Each system has its own formats: Windows uses PE (and before it NE and MS-DOS MZ), Linux and most Unix systems use ELF, and Apple’s systems use Mach-O. One .exe extension covers several formats, and so does .obj: see the .EXE overview and the .OBJ overview for how to tell them apart.

Formats

.A

AIX big archive

IBM AIX’s archive with linked members and 32-bit and 64-bit symbol tables.

.A

AIX small archive

The older AIX archive: linked members and one symbol table, in narrower fields.

.A

BSD and macOS static library

The ar archive format of macOS and the BSDs.

.A

System V and GNU static library

The ar archive format of Linux and most Unix systems.

.A

GNU thin archive

An archive that lists its members but leaves their data in other files.

.A2F

Apple II file

An Applesoft or Integer BASIC program or machine code from an Apple II disk.

.BBC

BBC Micro file

A BBC BASIC program or machine code from a BBC Micro disc or tape.

.BIN

Color Computer machine-language file

Tandy Color Computer and Dragon BIN files: segments with load addresses and an execution address, in 6809 code; found by structure, not by the name .bin.

.BIN

Raw machine code

Machine code with no header, read as the code of a CPU you choose; reached through Read as.

.COM

MS-DOS COM program

Small DOS programs with no header, loaded at offset 0x100.

.DLL

.NET assembly

.NET assemblies and modules: a PE file with ECMA-335 metadata tables, heaps and signatures.

.DOL

GameCube and Wii executable

Nintendo GameCube and Wii programs: a 256-byte header listing up to 18 sections, then the sections.

.DYLIB

Mach-O executable and library

Programs, .dylib libraries and universal binaries on macOS and iOS.

.ELF

Executable and Linkable Format

Programs, libraries and object files on Linux and Unix systems.

.EXE

Linear Executable (LE)

32-bit Windows VxD drivers and DOS extender programs, in paged objects.

.EXE

OS/2 executable (LX)

32-bit OS/2 programs and DLLs, in paged objects.

.EXE

MS-DOS executable (MZ)

16-bit DOS programs: an MZ header, relocations and the code.

.EXE

16-bit Windows executable (NE)

Windows 3.x and early OS/2 programs and DLLs, in movable segments.

.EXE

Windows executable (PE32)

32-bit Windows programs and DLLs, with a 32-bit optional header (magic 0x10B).

.EXE

Windows 64-bit executable (PE32+)

64-bit Windows programs and DLLs (x64, ARM64), with a 64-bit optional header (magic 0x20B).

.HUNK

Amiga HUNK file

Amiga programs, object files and link libraries: a list of hunks of code and data with relocations.

.KO

Linux kernel module

Loadable Linux drivers and features: ELF objects with module info.

.LIB

Windows COFF library

Windows linker libraries: COFF objects or DLL import records in an archive.

.LIB

Short import object

One member of an import library: a header and two strings.

.LIB

OMF library

A library of OMF object modules from 16-bit compilers.

.OBJ

Anonymous object header

The wrapper Microsoft’s compiler writes for link-time code generation.

.OBJ

COFF object file (bigobj)

The extended form of COFF, for objects with very many sections.

.OBJ

COFF object file

Compiled code from Windows compilers, waiting for the linker.

.OBJ

OMF object file

Intel’s object format for 16-bit DOS and Windows compilers, in typed records.

.OUT

Unix a.out executable

The original Unix executable: a 32-byte header, text, data and symbols.

.P00

PC64 single-file container

One Commodore 64 file with its name in a 26-byte C64File header (PC64).

.PRG

Commodore 64 program

C64 programs: a 2-byte load address, then BASIC and 6510 code.

.R00

PC64 REL file

One Commodore 64 relative file with its name and record size in a 26-byte C64File header (PC64), .r00 to .r99.

.REL

GameCube and Wii relocatable module

Nintendo GameCube and Wii modules a game loads at run time: sections, an import table and relocation lists.

.SAV

RT-11 SAV program

The DEC RT-11 program for the PDP-11: a memory image saved from address 0, with the start address, stack pointer and high limit in block 0.

.TOS

Atari ST executable

Atari ST, TT and Falcon programs (.PRG .TOS .TTP .APP .ACC): a header starting $601A, text and data, symbols and a relocation table.

.XEX

Atari 8-bit executable

Atari 8-bit programs: segments with addresses, run and init vectors.