Introduction
The static libraries on Linux and most Unix systems are ar archives in the System V layout, which GNU Binutils extended. Each member is usually an ELF object file. MinGW writes the same layout for Windows libraries, with COFF objects inside.
Structure
0signature!<arch>\n8 bytes8symbol index/, or/SYM64/with 64-bit offsets60 bytes + size…long names//, if any60 bytes + size…members60 bytes + size, even offsets
See the member header, the symbol index and long names.
Variants
- System V and GNU static library – the ar archive format of Linux and most Unix systems
- BSD and macOS static library – the ar archive format of macOS and the BSDs
- GNU thin archive – an archive that lists its members but leaves their data in other files
Links
Software
- GNU Binutils – GNU’s binary tools, with
ar,ranlibandnm(Linux, macOS, Windows) - LLVM – compiler toolkit with
llvm-arandllvm-nm(Linux, macOS, Windows)