LLVM-CXXMAP(1)

πŸ“¦ version 23.1.3, in centos-stream 9

πŸ’… LLVM-CXXMAP(1) β€” the mangled-name remapping tool, bestie edition

okay so first things first: this is part of the LLVM manual, and the page you're reading is LLVM-CXXMAP(1). we're talking about llvm-cxxmap, the mangled name remapping tool. she's niche, she's powerful, she's giving linker whisperer ✨

✨ NAME ✨

llvm-cxxmap β€” mangled name remapping tool πŸŽ€

🌸 SYNOPSIS 🌸

llvm-cxxmap [options] symbol-file-1 symbol-file-2

πŸ’– DESCRIPTION πŸ’–

so what does she do? llvm-cxxmap does fuzzy matching of C++ mangled names, and it decides what matches using a file that tells it which name components should be considered equivalent. that's the whole vibe. πŸ¦‹

your symbol files should each contain a list of C++ mangled names, one per line. blank lines? ignored. lines starting with #? also ignored, they're just commentary, we love a comment. πŸ’…

the output is a list of pairs of equivalent symbols, one per line, looking like this:

<symbol-1> <symbol-2>

where <symbol-1> is a symbol from symbol-file-1 and <symbol-2> is a symbol from symbol-file-2. and here's the cute part: mappings where the two symbols are identical get omitted. no point telling you what you already know, periodt. πŸ™ˆ

πŸ”₯ OPTIONS πŸ”₯

  • -remapping-file=file, -r=file β€” point this at a file holding the list of equivalence rules that decide whether two symbols are equivalent. Required, no cap. go read REMAPPING FILE below πŸ‘‡
  • -output=file, -o=file β€” the file where the list of matched names gets written. if you don't specify one, it just goes to stdout. lowkey convenient ✨
  • -Wambiguous β€” throws a warning if there are multiple equivalent (but distinct) symbols in symbol-file-2. like, which one, bestie?? 😭
  • -Wincomplete β€” throws a warning if symbol-file-1 contains a symbol that has no equivalent in symbol-file-2. the loneliness warning fr fr πŸ’€

🧚 REMAPPING FILE 🧚

okay this is the main character of the whole page. the remapping file is a text file with lines of this shape:

fragmentkind fragment1 fragment2

where fragmentkind is one of name, type, or encoding β€” telling you whether the following mangled name fragments are <name>s, <type>s, or <encoding>s respectively. and yes, blank lines and lines starting with # are ignored here too. consistent queen. πŸ‘‘

unmangled C names can be expressed as an encoding that is a (length-prefixed) <source-name>:

# C function "void foo_bar()" is remapped to C++ function "void foo::bar()".
encoding 7foo_bar _Z3foo3barv

and for convenience, built-in <substitution>s like St and Ss are accepted as <name>s β€” even though they technically are not <name>s. we don't gatekeep here 🫢

for example, to specify that absl::string_view and std::string_view should be treated as equivalent, you'd use this remapping file:

# absl::string_view is considered equivalent to std::string_view
type N4absl11string_viewE St17basic_string_viewIcSt11char_traitsIcEE

# std:: might be std::__1:: in libc++ or std::__cxx11:: in libstdc++
name St St3__1
name St St7__cxx11
NOTE: symbol remapping is currently only supported for C++ mangled names following the Itanium C++ ABI mangling scheme. that covers all C++ targets supported by Clang other than Windows targets. so like, don't come for her about MSVC, she simply does not do that πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). icons only 🌈

2003-2026, LLVM Project πŸ’œ


and that's the page!! slay πŸŽ€ this was LLVM-CXXMAP(1) from the LLVM manual, dated 2026-10-06, and yes the copyright is 2003-2026, LLVM Project β€” go forth and remap those names, bestie, you've got this πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from