RANLIB(1)
π RANLIB(1) β the GNU Development Tools glow-up
okay so bestie, quick vibe check: this whole page is about ranlib, one of the GNU Development Tools, and it's genuinely so much simpler than it looks. stick with me π«Ά
β¨ NAME β¨
ranlib β generate an index to an archive. that's it. that's the whole job. iconic honestly π
π SYNOPSIS π
ranlib [--plugin name] [-DhHvVt] archive
like, look at that. one archive, a handful of flags, we're done. slay.
πΈ DESCRIPTION πΈ
so ranlib generates an index to the contents of an archive and stores it in the archive. yes, right in there, tucked in π
the index lists each symbol defined by a member of an archive that is a relocatable object file.
you can peek at this index with nm -s or nm --print-armap, iykyk π
and the reason you'd even want this? an archive with such an index speeds up linking to the library. lowkey the whole point. faster linking = main character energy π₯
here's the part that's giving "small world": the GNU ranlib program is another form of GNU ar. running ranlib is completely equivalent to executing ar -s. literally identical. no cap. π
β OPTIONS β
-h,-H,--helpβ show usage information forranlib. the "help me help you" button π-v,-V,--versionβ show the version number ofranlib. flex the build, bestie πββοΈ-Dβ operate in deterministic mode. the symbol map archive member's header will show zero for the UID, GID, and timestamp. when this option is used, multiple runs will produce identical output files. repeatable, reproducible, obsessed β¨
if binutils was configured with --enable-deterministic-archives, then this mode is on by default. it can be disabled with the -U option, described below.
-tβ update the timestamp of the symbol map of an archive. little refresh, no big deal π-Uβ do not operate in deterministic mode. this is the inverse of the-Doption, above: the archive index will get actual UID, GID, timestamp, and file mode values. real values only, no cosplay π
if binutils was configured without --enable-deterministic-archives, then this mode is on by default.
@file β read command-line options from file. the options read are inserted in place of the original@file option. if file does not exist, or cannot be read, then the option will be treated literally, and not removed. (not me expecting it to just vanish π)
options in file are separated by whitespace. a whitespace character may be included in an option by surrounding the entire option in either single or double quotes. any character (including a backslash) may be included by prefixing the character to be included with a backslash. the file may itself contain additional @file options; any such options will be processed recursively. it's turtles all the way down, fr fr π’
heads up bestie: that last @file one is a whole lituation β recursive file reading, quoting rules, backslash escaping. read it twice before you go off-script π
π¦ SEE ALSO π¦
go read those too, they're the supporting cast and they ate π
π COPYRIGHT π
Copyright (c) 1991-2026 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
okay that's the whole page, you're officially a ranlib girlie now π this lil beauty is binutils-2.47, dated 2026-08-31 β go forth and index those archives, periodt πβ¨
π¦ where this page comes from
- arch rolling: riscv64-linux-gnu-binutils 2.47-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms