List the members of a static library with ar t
List the object files inside a .a archive with ar t, add v for sizes and dates, and see duplicate member names that ar extracts only one at a time.
A static library is an archive of object files, and ar t is its table of contents. It is the first thing to run when a link pulls in more code than you expected, or when you want to know whether a library has the object you need.
ar t libutil.a
ar tv libutil.astrutil.o
mathutil.o
rw-r--r-- 0/0 1248 Jan 1 00:00 1970 strutil.o
rw-r--r-- 0/0 1096 Jan 1 00:00 1970 mathutil.oThe verbose form shows permissions, owner and group, size, date and name. Zeroes for owner and the 1970 date mean the archive was built in deterministic mode, which is what reproducible builds want.
Archives allow two members with the same name, and ar t then prints the name twice. That happens when a build script appends objects from two directories that each hold a util.o. Extracting by name gets only the first one, and you pick the second with the N modifier, for example ar xN 2 libutil.a util.o. The linker does not care, since it works from the symbol index and pulls in whichever member defines a needed symbol.
ar t shows members, not symbols. To see which symbols each member holds, use nm -A or nm -s. Both tools are documented in the ar manual, and the dates shown depend on how the archive was built.