RANLIB(1)

✨ ranlib β€” like, the manual page for it πŸ’–

okay bestie, so this is RANLIB(1), part of the GNU Development Tools family, and honestly? she's a quiet icon. no drama, just vibes and symbol indexes. let's get into it 🫢


🌸 NAME 🌸

ranlib β€” generate an index to an archive ✨


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? ranlib generates an index to the contents of an archive and stores it in the archive. that index lists every symbol defined by a member of an archive that is a relocatable object file. periodt. πŸ’…

you can peek at that index with nm -s or nm --print-armap, btw β€” iykyk πŸ‘€

and why do we care? because an archive with such an index speeds up linking to the library. literally that's the whole point, she's a performance queen πŸ‘‘

now here's the cute part: the GNU ranlib program is another form of GNU ar. running ranlib is completely equivalent to executing ar -s. same energy, different name. iconic 🌈


✨ OPTIONS ✨

  • -h, -H, --help β€” show usage information for ranlib. that's it, that's the option. she's helpful and unbothered πŸ’
  • -v, -V, --version β€” show the version number of ranlib. good for when you need to know exactly which one you're dealing with πŸ“
  • -D β€” operate in deterministic mode. the symbol map archive member's header will show zero for the UID, GID, and timestamp. and with this option on, multiple runs will produce identical output files β€” reproducibility slay bestie 🧚
heads up: if binutils was configured with --enable-deterministic-archives, then this mode is on by default. you can turn it off with the -U option, described right below πŸ‘‡
  • -t β€” update the timestamp of the symbol map of an archive. tiny touch-up, no big deal πŸ’…
  • -U β€” do not operate in deterministic mode. this is the exact inverse of -D above: the archive index will get actual UID, GID, timestamp, and file mode values. raw and real, no filter 😀
and if binutils was configured without --enable-deterministic-archives, then this mode is on by default. flip flop of the whole situation, love that for her πŸ’œ
  • @file β€” read command-line options from file. the options read are inserted in place of the original @file option. and if file doesn't exist, or can't be read? then the option will be treated literally, and not removed. no silent failures, no ghosting πŸ™ˆ

options in file are separated by whitespace. want whitespace inside an option? just surround the entire option in either single or double quotes. want literally any character (yes, even a backslash)? prefix the character you want with a backslash. and plot twist β€” the file may itself contain additional @file options, and any such options will be processed recursively. it's giving inception, and we're obsessed πŸŒ€


πŸ”₯ SEE ALSO πŸ”₯

  • ar(1)
  • nm(1)
  • and the Info entries for binutils. go read them, bestie, they're cute too πŸ“š

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, no notes πŸ’– this little legend comes to you from binutils-2.47, dated 2026-09-19 β€” so go forth, index that archive, and be the main character of your own link step. mwah πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from