ABIMAP(1)

๐Ÿ“ฆ
version 0.4.0 ยท 2 versions
, in fedora 43

๐Ÿฆ‹ abimap(1) ๐Ÿฆ‹

okay bestie, welcome to the abimap(1) manual, and I need you to read the whole thing ๐Ÿ’…

โœจ NAME โœจ

abimap - Generate and update linker version scripts ๐ŸŒธ

๐Ÿ’– SYNOPSIS ๐Ÿ’–

abimap [-h] {update,new,check,version} ...

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so abimap is a tool that generates and updates linker scripts, and those scripts slap version info onto the symbols a shared library exports โœจ it's giving organized ๐Ÿ’…

it's meant to live inside your build process ๐Ÿ”ฅ it checks for changes in the set of exported symbols and updates the symbol version linker script to match. no more manually keeping track, slay ๐Ÿ˜ญ

the complete documentation lives at https://abimap.readthedocs.io ๐Ÿฆ‹

๐ŸŒˆ OPTIONS ๐ŸŒˆ

  • -h, --help โ€” shows you the available options and subcommands ๐Ÿ’–

๐Ÿ‘‘ SUBCOMMANDS ๐Ÿ‘‘

๐Ÿงš abimap update

Updates an existing map file. Main character energy ๐Ÿ’…

abimap update [-h] [-o OUT] [-i INPUT] [-d]
              [--verbosity {quiet,error,warning,info,debug} | --quiet | --debug]
              [-l LOGFILE] [-n NAME] [-v VERSION]
              [-r RELEASE] [--no_guess] [--allow-abi-break]
              [-f] [-a | --remove]
              file
  • file โ€” the map file being updated ๐Ÿซถ
  • -o OUT, --out OUT โ€” where the output goes (defaults to stdout) ๐Ÿ“
  • -i INPUT, --in INPUT โ€” reads from this file instead of stdio ๐Ÿ“„
  • -d, --dry โ€” does everything, but won't touch the files at all ๐Ÿ™ˆ
  • --verbosity {quiet,error,warning,info,debug} โ€” sets how chatty the program is โœจ
  • --quiet โ€” makes the program quiet ๐Ÿคซ
  • --debug โ€” makes the program print debug info ๐Ÿ”
  • -l LOGFILE, --logfile LOGFILE โ€” logs everything to this file ๐Ÿ“
  • -n NAME, --name NAME โ€” the name of the library, like libx ๐Ÿฆ‹
  • -v VERSION, --version VERSION โ€” the release version, like 1_0_0 or 1.0.0 ๐Ÿ’œ
  • -r RELEASE, --release RELEASE โ€” the full name of the release, like LIBX_1_0_0 ๐Ÿ‘‘
  • --no_guess โ€” turns off the next release name guessing ๐Ÿ™…โ€โ™€๏ธ
  • --allow-abi-break โ€” lets you remove symbols and break the ABI. big risk, bestie ๐Ÿ’€
  • -f, --final โ€” marks the modified release as final, so nobody can change it later ๐Ÿ”’
  • -a, --add โ€” adds the symbols to the map file โž•
  • --remove โ€” removes the symbols from the map file. This breaks the ABI. ๐Ÿ’€
๐Ÿšจ Heads up: --remove and --allow-abi-break both break the ABI. Use them with extreme care, bestie, or your users will be sad ๐Ÿ˜ญ

๐ŸŒธ abimap new

Creates a brand new map file โœจ

abimap new [-h] [-o OUT] [-i INPUT] [-d]
           [--verbosity {quiet,error,warning,info,debug} | --quiet | --debug]
           [-l LOGFILE] [-n NAME] [-v VERSION] [-r RELEASE]
           [--no_guess] [-f]
  • -o OUT, --out OUT โ€” where the output goes (defaults to stdout) ๐Ÿ“
  • -i INPUT, --in INPUT โ€” reads from this file instead of stdio ๐Ÿ“„
  • -d, --dry โ€” does everything, but won't modify the files ๐Ÿ™ˆ
  • --verbosity {quiet,error,warning,info,debug} โ€” sets the program verbosity โœจ
  • --quiet โ€” makes the program quiet ๐Ÿคซ
  • --debug โ€” makes the program print debug info ๐Ÿ”
  • -l LOGFILE, --logfile LOGFILE โ€” logs to this file ๐Ÿ“
  • -n NAME, --name NAME โ€” the name of the library, like libx ๐Ÿฆ‹
  • -v VERSION, --version VERSION โ€” the release version, like 1_0_0 or 1.0.0 ๐Ÿ’œ
  • -r RELEASE, --release RELEASE โ€” the full name of the release, like LIBX_1_0_0 ๐Ÿ‘‘
  • --no_guess โ€” turns off the next release name guessing ๐Ÿ™…โ€โ™€๏ธ
  • -f, --final โ€” marks the new release as final, so no later changes allowed ๐Ÿ”’

๐Ÿฆ‹ abimap check

Checks the syntax of a map file. vibe check โœ…

abimap check [-h]
             [--verbosity {quiet,error,warning,info,debug} | --quiet | --debug]
             [-l LOGFILE]
             file
  • file โ€” the map file to be checked ๐Ÿซถ
  • --verbosity {quiet,error,warning,info,debug} โ€” sets the program verbosity โœจ
  • --quiet โ€” makes the program quiet ๐Ÿคซ
  • --debug โ€” makes the program print debug info ๐Ÿ”
  • -l LOGFILE, --logfile LOGFILE โ€” logs to this file ๐Ÿ“

๐Ÿ’… abimap version

Prints the tool version number. iconic behaviour, no notes ๐Ÿ’–

usage:

abimap version [-h]

๐Ÿซง NOTES ๐Ÿซง

๐Ÿ”ฎ Why use symbol versioning?

okay the main reason is to keep the library [ABI] stable ๐Ÿซถ

if a library is meant to be used for a long time, it's gonna need updates for bug fixes and/or improvements ๐Ÿ› ๏ธ and that can lead to changes in the [API] and, in the worst case, changes to the [ABI] ๐Ÿ˜ญ

with symbol versioning, you can make compatible changes and keep applications working without recompiling โœจ if incompatible changes happen (breaking the [ABI]), symbol versioning lets both incompatible versions live on the same system without conflict ๐Ÿ™Œ and even more uncommon situations are covered, like an application being linked to different (incompatible) versions of the same library ๐Ÿคฏ

for more info, I 100% recommend reading:

  • [HOW_TO] How to write shared libraries, by Ulrich Drepper ๐Ÿ“–

๐ŸŒท How to add symbol versioning to my library?

adding version info to the symbols is easy, bestie. keeping the [ABI] stable, unfortunately, is not ๐Ÿ˜ญ this project is here to help with the first part ๐Ÿฆ‹

to add version info to a library's symbols, you can use version scripts (in Linux). version scripts are files that linkers use to map symbols to a given version. they contain the symbols exported by the library, grouped by the releases where they were introduced. for example:

   LIB_EXAMPLE_1_0_0
     {
       global:
         symbol;
         another_symbol;
       local:
         *;
     };

in this example, the release LIB_EXAMPLE_1_0_0 introduces the symbols symbol and another_symbol. the * wildcard in local catches all the other symbols, so only symbol and another_symbol are globally exported as part of the library [API] ๐Ÿ’–

if a compatible change is made, it'd introduce a new release, like:

   LIB_EXAMPLE_1_0_0
   {
       global:
           symbol;
           another_symbol;
       local:
           *;
   };

   LIB_EXAMPLE_1_1_0
   {
       global:
           new_symbol;
   } LIB_EXAMPLE_1_0_0;

the new release LIB_EXAMPLE_1_1_0 introduces the symbol new_symbol โœจ the * wildcard should only be in one version, usually the oldest one ๐Ÿ‘‘ and the } LIB_EXAMPLE_1_0_0; at the end of the new release means the new release depends on the old release ๐Ÿซถ

now suppose a new incompatible version, LIB_EXAMPLE_2_0_0, gets released after LIB_EXAMPLE_1_1_0. its map would look like:

   LIB_EXAMPLE_2_0_0
   {
       global:
           a_newer_symbol;
           another_symbol;
           new_symbol;
       local:
           *;
   };

the symbol symbol was removed (and that's why it was incompatible) ๐Ÿ’€ and a new symbol, a_newer_symbol, was introduced ๐ŸŒˆ

note that all global symbols from all releases got merged into one unique new release ๐Ÿซง

๐Ÿ“š References:

๐Ÿ‘ธ AUTHOR ๐Ÿ‘ธ

Anderson Toshiyuki Sasaki <ansasaki@redhat.com> ๐Ÿ’–

2025, Anderson Toshiyuki Sasaki <ansasaki@redhat.com> ๐ŸŒˆ


that's the whole tea, bestie ๐Ÿซถ this page is for abimap version 0.4.0, last updated Sep 19, 2025, and it's giving ABIMAP(1) forever ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from