Introduction
A thin archive holds a symbol index and a list of its members, but not their data. ar T in GNU Binutils makes one, and it is used inside large builds to save disk space. A linker reads the members from the original files.
Structure
0signature!<thin>\n8 bytes8symbol index/60 bytes + size…long names//60 bytes + size…member headers60 bytes each, no data
The member header
Each is 60 bytes, in the layout of a System V and GNU archive, but no data follows it. The Size field gives the size of the file the header points at, elsewhere on disk, and the next header follows immediately.
Long names
A member’s name is usually a path, stored in the // member in the same form as in a GNU archive: a slash and a decimal offset in the name field, and the entry ending with a slash and a newline. The / and // members are stored in the archive like any other, with their data after the header.
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;
ar Tmakes a thin archive (Linux, macOS, Windows)
Reference
- GNU ar – the Binutils manual for the
arcommand