.TH ranlib "" "" Command
.PC "Create index for object library"
\fBranlib \fIlibrary ... \fR
.PP
The 
.B ranlib
is a \*(QLdirectory\*(QR that appears at the beginning of each library.
It contains the name of each global symbol (i.e., function name)
that appears within the library, and a pointer to the module in which
that symbol is defined.
Thus, the ranlib eliminates the need for the linker to search the
entire library sequentially to find a given global symbol, which
speeds up linking noticeably.
.PP
If the date on the library file is later than that in the ranlib
header, the linker will ignore the ranlib and perform a sequential
search through the library; the linker will also send the warning
message
.DM
	Outdated ranlib
.DE
.PP
to the standard error device.
This is done to prevent the accidental use of an outdated ranlib,
which could be disastrous.
.PP
The command
.B ranlib
creates a ranlib header for an archive.
If the header already exists,
.B ranlib
updates it.
.SH Files
\fB__.SYMDEF\fR \(em Index module
.SH "See Also"
.Xr "ar," ar
.Xr "ar.h," ar.h
.Xr "commands," commands
.Xr "ld" ld
.SH Diagnostics
.B ranlib
issues appropriate messages for I/O errors or bad format files.
It does not rewrite a library until the last possible moment,
so the library is usually unchanged in case of error.
.B ranlib
processes each library independently.
The exit status is the number of libraries in which errors were encountered.
.PP
.B ranlib
is a link to the archiver
.BR ar .
