RANLIB(1)

πŸ“¦ version 2.47, in arch rolling

🌸 RANLIB(1) β€” bestie's guide to archive indexes 🌸

okay so real talk, this one lives in the GNU Development Tools section of your man pages, and it's genuinely one of the shortest little guys you'll ever meet. let's get into it 🫢


✨ NAME ✨

ranlib β€” generate an index to an archive

like, it builds the lil' table of contents for your archive. that's the whole job. iconic behavior honestly πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

ranlib [--plugin name] [-DhHvVt] archive

that's it. that's the whole vibe. one archive, a handful of flags, done. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: ranlib generates an index to the contents of an archive and stores it in the archive. the index lists each symbol defined by a member of an archive that is a relocatable object file. so every symbol in every relocatable object file inside the archive gets a little shoutout in the index. no cap. ✨

want to actually see that index? you can use nm -s or nm --print-armap to list it. go look, it's right there. 😌

and here's why you should care: an archive with such an index speeds up linking to the library. it's giving "pre-organized closet" energy. future you says thank you. πŸ”₯

plot twist though β€” the GNU ranlib program is another form of GNU ar. running ranlib is completely equivalent to executing ar -s. literally the same thing wearing a different outfit. πŸ’€


πŸ’– OPTIONS πŸ’–

  • -h, -H, --help β€” show usage information for ranlib. little help menu moment. 🧚
  • -v, -V, --version β€” show the version number of ranlib. who are you, ranlib? which era are you from? ⭐
  • -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. reproducible queen behavior πŸ‘‘
heads up: if binutils was configured with --enable-deterministic-archives, then this mode is on by default. and it can be disabled with the -U option, described below. iykyk 🫢
  • -t β€” update the timestamp of the symbol map of an archive. just a lil refresh, a little "i'm still here" glow-up. ✨
  • -U β€” do not operate in deterministic mode. this is the inverse of the -D option, above: the archive index will get actual UID, GID, timestamp, and file mode values. so like, real values. real ones only. 🌈
and if binutils was configured without --enable-deterministic-archives, then this mode is on by default. so it's the default unless it's not. classic. πŸ™ˆ
  • @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. 😭

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. and bestie β€” the file may itself contain additional @file options; any such options will be processed recursively. it's @files all the way down. πŸŒ€


πŸ“ SEE ALSO πŸ“

ar(1), nm(1), and the Info entries for binutils. go read those too, they're the friends of this page. πŸ’œ


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".


and that's the whole page, bestie πŸŽ€ this one came from binutils-2.47, dated 2026-08-26 β€” catch you on the next man page, mwah πŸ’‹

πŸ“¦ where this page comes from