LLVM-IFS(1)
π LLVM-IFS π
okay bestie, gather round, because today we're learning about llvm-ifs β that's the LLVM shared object stubbing tool, from the LLVM manual, and honestly? it's giving lowkey iconic. β¨
π«Ά NAME π«Ά
llvm-ifs β the shared object stubbing tool. that's it, that's the whole name, no notes. π
πΈ SYNOPSIS πΈ
llvm-ifs [options] inputs
π¦ DESCRIPTION π¦
so llvm-ifs is that girl fr fr. she jointly produces human-readable text-based stubs (the .ifs files) for shared objects and linkable shared object stubs (the .so files), and she can do it starting from either ELF shared objects or text-based stubs. no cap. π₯
the text-based stubs are super useful for monitoring ABI changes of the shared object β like a little vibe check for your ABI, iykyk. and the linkable shared object stubs? those let you avoid unnecessary relinks when the ABI of shared libraries doesn't actually change. obsessed. π
π IFS FORMATS π
here's an example of the text representation (IFS) of a shared object that llvm-ifs produces, and yes you're gonna want to screenshot this:
--- !ifs-v1
IFSVersion: 3.0
SoName: libtest.so /* Optional */
Target: x86_64-unknown-linux-gnu /* Optional, format 1, same format as llvm target triple */
Target: { Arch: x86_64, Endianness: little, Bitwidth: 64 } /* Optional, format 2 */
NeededLibs:
- libc.so.6
Symbols:
- { Name: sym0, Type: Notype }
- { Name: sym1, Type: Object, Size: 0 }
- { Name: sym2, Type: Func, Weak: false }
- { Name: sym3, Type: TLS }
- { Name: sym4, Type: Unknown, Warning: foo }
...
now let's break down every single one of these fields, because we do NOT skip details in this house π:
- IFSVersion: the version of the IFS file, for reader compatibility. gotta make sure the reader knows what it's getting into.
- SoName (optional): the name of the shared object file that is being stubbed.
- Target (optional): the architecture, endianness and bitwise information of this shared object. it can come in explicit format or in implicit LLVM triple format β dealer's choice. it's optional, and it can be overridden from command line options. main character energy, honestly.
- NeededLibs: the list of the external shared objects that this library depends on. it's giving "who's in your circle".
- Symbols: a collection of all data needed to link objects for each symbol, sorted by name in ascending order. tidy queen π§
- Name: symbol name.
- Type: whether the symbol is an object, function, no-type, thread local storage, or unknown. symbol types that aren't explicitly supported get mapped as unknown, to improve signal-to-noise ratio β no drama, just clean data.
- Size: the size of the symbol in question. it doesn't apply to functions, and it's optional for NoType symbols.
- Undefined: whether or not the symbol is defined in this shared object file.
- Weak: whether or not the symbol should be treated as weak.
- Warning (optional): warning text to output when this symbol is linked against. a lil heads-up, a lil PSA. π«Ά
this YAML based text format contains everything that's needed to generate a linkable ELF shared object as well as an Apple TAPI format file. the ordering of symbols is sorted, so these files can be easily compared using diff tools β periodt. and here's the thing: if the content of the file changes, it indicates a potentially ABI breaking change. π so yeah, watch those diffs.
π ELF STUB FORMAT π
a minimum ELF file that can be used by a linker should have the following sections properly populated:
- ELF header.
- Section headers.
- Dynamic symbol table (
.dynsymsection). - Dynamic string table (
.dynstrsection). - Dynamic table (
.dynamicsection).DT_SYMTABentry.DT_STRTABentry.DT_STRSZentry.DT_NEEDEDentries. (optional)DT_SONAMEentry. (optional)
- Section header string table (
.shstrtabsection).
β οΈ heads up bestie: this ELF file may have compatibility issues with ELF analysis tools that rely on the program headers. that's just how it is. but linkers like LLD work fine with such a minimum ELF file, without errors. slay. β¨
β¨ OPTIONS β¨
one bullet per flag, no skipping, we're doing all of them π
--input-format=[IFS|ELF|OtherObjectFileFormats]β specify the input file format. currently, only text IFS files and ELF shared object files are supported. this flag is optional because the input format can be inferred. she reads the room. π--output-elf=<output-filename>β specify the output file for the ELF shared object stub.--output-ifs=<output-filename>β specify the output file for the text IFS.--output-tbd=<output-filename>β specify the output file for the Apple TAPI tbd.--arch=[x86_64|AArch64|...]β this flag is optional, and it should only be used when reading an IFS file which does not define the Arch (architecture). it defines the architecture of the output file, and it can be any string supported by the ELFe_machinefield. if the value is conflicting with the IFS file, an error will be reported and the program will stop. π--endianness=[little|big]β optional, and only for reading an IFS file which doesn't define the Endianness. it defines the endianness of the output file. if the value conflicts with the IFS file, an error will be reported and the program will stop.--bitwidth=[32|64]β optional, and only for reading an IFS file which doesn't define the BitWidth. it defines the bit width of the output file. if the value conflicts with the input IFS file, an error will be reported and the program will stop.--target=<target triple>β optional, and should only be used when reading an IFS file which doesn't define any target information. it defines architecture, endianness and bit width of the output file using an llvm target triple. π― this flag cannot be used simultaneously with other target related flags β pick a lane.--hint-ifs-target=<target triple>β optional, and should only be used when reading an ELF shared object and generating an IFS file. by default,llvm-ifswill use the'Arch, Endianness and BitWidth'fields to reflect the target information from the input object file. using this flag tellsllvm-ifsthe expected target triple in the output IFS file. if the value matches the target information from the object file, this value will be used in the'Target:'field in the generated IFS. if it conflicts with the input object file, an error will be reported and the program will stop.--hint-ifs-targetβ optional, and should only be used when outputting an IFS file. this flag strips the Arch field from the IFS file so it can be overridden later. bye arch π--strip-ifs-endiannessβ optional, and should only be used when outputting an IFS file. this flag strips the Endianness field from the IFS file so it can be overridden later.--strip-ifs-bitwidthβ optional, and should only be used when outputting an IFS file. this flag strips the BitWidth field from the IFS file so it can be overridden later.--strip-ifs-targetβ optional, and should only be used when outputting an IFS file. this flag strips the Target field from the IFS file so it can be overridden later.--write-if-changedβ when this flag is set,llvm-ifswill only write the output file if it does not already exist or the content will be different from the existing file. no unnecessary writes, we're efficient. π--strip-sizeβ when this flag is set,llvm-ifswill remove the size field from the output ifs file. this is useful for shared objects that only intend to be linked against position independent code which doesn't need copy relocations, or where the size of an object is not a useful part of the abi to track. size? never heard of her. π
π EXIT STATUS π
if llvm-ifs succeeds, it will exit with 0. otherwise, if an error occurs, it will exit with a non-zero value. simple as that, bestie.
π Author π
maintained by the LLVM Team (https://llvm.org/). give them their flowers π
β Copyright β
2003-2026, LLVM Project
and that's the whole page, bestie! this was the LLVM manual, page 22, dated 2026-07-16 β so if you ever forget when this vibe was documented, now you know. go forth and stub responsibly. ππ¦π
π¦ where this page comes from
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms