RANLIB(1)
π ranlib π
okay so bestie, welcome to the GNU Development Tools manual, this one's all about ranlib and it's genuinely so useful, no cap β¨
π NAME π
ranlib β generate an index to an archive. that's it. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
ranlib [--plugin name] [-DhHvVt] archive
πΈ DESCRIPTION πΈ
so ranlib generates an index to the contents of an archive and stores it in the archive. icon behavior, honestly. π
the index lists each symbol defined by a member of an archive that is a relocatable object file. that's the whole thing it does and it does it slayfully.
you can peek at this index with nm -s or nm --print-armap. using it to actually look at your index? main character energy. π
an archive with such an index speeds up linking to the library and allows routines in the library to call each other without regard to their placement in the archive. literally so convenient, the routines don't even need to know where their friends live π«Ά
and here's the fun tea: the GNU ranlib program is another form of GNU ar. running ranlib is completely equivalent to executing ar -s. same thing, different outfit. periodt. π
π¦ OPTIONS π¦
-h,-H,--helpβ show usage information forranlib. it's giving "help me help you" π₯Ί-v,-V,--versionβ show the version number ofranlib. iykyk, sometimes you just gotta know what you're working with π₯-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! π
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. good to know, fr fr.
-tβ update the timestamp of the symbol map of an archive. a lil refresh, she needed a glow-up β-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. chaotic, unreproducible, real. π
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@fileoption. if file does not exist, or cannot be read, then the option will be treated literally, and not removed. it's giving "no file? no problem, you're a literal string now" π
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. recursion bestie!! π§ it goes all the way down π
π SEE ALSO π
go read them, they're iconic too π
π COPYRIGHT π
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".
like, legal but make it cute π
ngl none of this is dangerous, you're literally just indexing an archive. go off π¦
okay that's the whole page bestie!! this was binutils-2.45.1, dated 2026-01-23 β you're all caught up, mwah πβ¨πΈ
π¦ where this page comes from
- arch rolling: or1k-elf-binutils 2.45.1-1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms