RANLIB(1)

πŸ“¦
version 2.45.50.20251209 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– RANLIB(1) β€” bestie edition πŸ’–

okay so welcome to the GNU Development Tools glow-up corner, where we're talking about ranlib, and honestly? she's an icon and she's been carrying your link times since forever. πŸ‘‘


✨ NAME ✨

ranlib β€” generate an index to an archive


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: 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. πŸ“‡

You can peep that index yourself with nm -s or nm --print-armap. Go look, she's pretty.

An archive with such an index speeds up linking to the library, and β€” this is the part that's giving main character energy β€” it allows routines in the library to call each other without regard to their placement in the archive. No cap. Order stops mattering. ✨

Also, fun fact: the GNU ranlib program is another form of GNU ar. Running ranlib is completely equivalent to executing ar -s. Same girl, different name. πŸ’…


πŸ’… OPTIONS πŸ’…

  • -h, -H, --help β€” Show usage information for ranlib. She's helpful, she's humble, she tells you how to use her. 🫢
  • -v, -V, --version β€” Show the version number of ranlib. Identity check, slay. 🌸
  • -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. Fr fr, byte-for-byte twins. πŸ‘―

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. Just the timestamp. A little refresh, a little self-care. ⏰
  • -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.

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. πŸ™ˆ

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 giving inception. πŸŒ€

🚨 bestie heads up: recursive @file includes go all the way down, so don't go pointing files at each other in a little loop, okay? iykyk.

πŸ‘€ SEE ALSO πŸ‘€

ar(1), nm(1), and the Info entries for binutils.


Copyright (c) 1991-2025 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, babe. this one shipped as part of binutils-2.45.50, dated 2025-12-09, and it's the RANLIB(1) manual page β€” go forth and index your archives, you absolute legend. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from