LLVM-SYMBOLIZER(1)

๐ŸŒธ NAME ๐ŸŒธ

okay bestie, welcome to the LLVM manual page for llvm-symbolizer โ€” that's LLVM-SYMBOLIZER(1) if you're keeping track ๐ŸŽ€โœจ โ€” and it does exactly one iconic thing: it converts addresses into source code locations. periodt.

โœจ SYNOPSIS โœจ

llvm-symbolizer [options] [addresses...]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

So llvm-symbolizer reads input names and addresses from the command-line and prints the corresponding source code locations to standard output. It can also symbolize logs containing Symbolizer Markup <> via --filter-markup. Addresses may be specified as numbers or symbol names. no cap, it's giving "turn raw addresses into lore" ๐Ÿ”ฅ

If no address is specified on the command-line, it reads the addresses from standard input. If no input name is specified on the command-line, but addresses are, the first address value is treated as an input name. If an input value is not recognized, it reports that source information is not found. ๐Ÿ’…

Input names can be specified together with the addresses either on standard input or as positional arguments on the command-line. By default, input names are interpreted as object file paths. However, prefixing a name with BUILDID: states that it is a hex build ID rather than a path. This will look up the corresponding debug binary. For consistency, prefixing a name with FILE: explicitly states that it is an object file path (the default). ๐Ÿซถ

A positional argument or standard input value can be preceded by "DATA" or "CODE" to indicate that the address should be symbolized as data or executable code respectively. If neither is specified, "CODE" is assumed. DATA is symbolized as address and symbol size rather than line number. lowkey important, bestie ๐Ÿ˜ญ

llvm-symbolizer parses options from the environment variable LLVM_SYMBOLIZER_OPTS after parsing options from the command line. LLVM_SYMBOLIZER_OPTS is primarily useful for supplementing the command-line options when llvm-symbolizer is invoked by another program or runtime. it's giving "runtime said lemme add a little something" ๐Ÿ’€

๐ŸŽ€ EXAMPLES ๐ŸŽ€

All of the following examples use the following two source files as input. They use a mixture of C-style and C++-style linkage to illustrate how these names are printed differently (see --demangle). ๐ŸŒˆ

// test.h
extern "C" inline int foz() {
  return 1234;
}
// test.cpp
#include "test.h"
int bar=42;

int foo() {
  return bar;
}

int baz() {
  volatile int k = 42;
  return foz() + k;
}

int main() {
  return foo() + baz();
}

These files are built as follows:

$ clang -g test.cpp -o test.elf
$ clang -g -O2 test.cpp -o inlined.elf

โญ Example 1 โ€” addresses and object on command-line:

$ llvm-symbolizer --obj=test.elf 0x4004d0 0x400490
foz
/tmp/test.h:1:0

baz()
/tmp/test.cpp:11:0

โญ Example 2 โ€” addresses on standard input:

$ cat addr.txt
0x4004a0
0x400490
0x4004d0
$ llvm-symbolizer --obj=test.elf < addr.txt
main
/tmp/test.cpp:15:0

baz()
/tmp/test.cpp:11:0

foz
/tmp/./test.h:1:0

โญ Example 3 โ€” object specified with address:

$ llvm-symbolizer "test.elf 0x400490" "FILE:inlined.elf 0x400480"
baz()
/tmp/test.cpp:11:0

foo()
/tmp/test.cpp:8:10

$ cat addr2.txt
FILE:test.elf 0x4004a0
inlined.elf 0x400480

$ llvm-symbolizer < addr2.txt
main
/tmp/test.cpp:15:0

foo()
/tmp/test.cpp:8:10

โญ Example 4 โ€” BUILDID and FILE prefixes:

$ llvm-symbolizer "FILE:test.elf 0x400490" "DATA BUILDID:123456789abcdef 0x601028"
baz()
/tmp/test.cpp:11:0

bar
6295592 4

$ cat addr3.txt
FILE:test.elf 0x400490
DATA BUILDID:123456789abcdef 0x601028

$ llvm-symbolizer < addr3.txt
baz()
/tmp/test.cpp:11:0

bar
6295592 4

โญ Example 5 โ€” CODE and DATA prefixes:

$ llvm-symbolizer --obj=test.elf "CODE 0x400490" "DATA 0x601028"
baz()
/tmp/test.cpp:11:0

bar
6295592 4

$ cat addr4.txt
CODE test.elf 0x4004a0
DATA inlined.elf 0x601028

$ llvm-symbolizer < addr4.txt
main
/tmp/test.cpp:15:0

bar
6295592 4

โญ Example 6 โ€” path-style options:

This example uses the same source file as above, but the source file's full path is /tmp/foo/test.cpp and is compiled as follows. The first case shows the default absolute path, the second --basenames, and the third shows --relativenames. ๐Ÿฆ‹

$ pwd
/tmp
$ clang -g foo/test.cpp -o test.elf
$ llvm-symbolizer --obj=test.elf 0x4004a0
main
/tmp/foo/test.cpp:15:0
$ llvm-symbolizer --obj=test.elf 0x4004a0 --basenames
main
test.cpp:15:0
$ llvm-symbolizer --obj=test.elf 0x4004a0 --relativenames
main
foo/test.cpp:15:0

โญ Example 7 โ€” Addresses as symbol names:

$ llvm-symbolizer --obj=test.elf main
main
/tmp/test.cpp:14:0
$ llvm-symbolizer --obj=test.elf "CODE foz"
foz
/tmp/test.h:1:0

โญ Example 8 โ€” --skip-line-zero output for an address with no line correspondence (an address associated with line zero):

// test.c
int foo = 0;
int x = 1234;
int main() {
  if (x)
    return foo;
  else
    return x;
}

These files are built as follows:

$ clang -g -O2 -S test.c -o test.s
$ llvm-mc -filetype=obj -triple=x86_64-unknown-linux  test.s -o test.o

$ llvm-symbolizer --obj=test.o --skip-line-zero 0xa
main
/tmp/test.c:5:7 (approximate)

๐Ÿ’… OPTIONS ๐Ÿ’…

Okay bestie, buckle up โ€” this is the part where we go through literally every single flag, and there are a lot. But it's all here, nothing skipped. ๐ŸŽ€

  • --adjust-vma <offset> โ€” adds the offset you give it to object file addresses when it's doing lookups. Basically it lets you perform lookups as if the object were relocated by that offset. ๐Ÿฆ‹
  • --skip-line-zero โ€” if an address doesn't have an associated line number, use the last line number from the current sequence in the line-table instead. Heads up though: those lines get labeled as "approximate" in the output, because they may be misleading. ๐Ÿ˜ญ
  • --basenames, -s โ€” prints just the file's name with no directories at all, instead of the absolute path. โœจ
  • --build-id โ€” looks up the object using the given build ID, which you specify as a hexadecimal string. Mutually exclusive with --obj. ๐Ÿšซ
  • --color [=<always|auto|never>] โ€” sets whether color is used in --filter-markup mode. Defaults to auto, which detects whether standard output supports color. Just specifying --color on its own is equivalent to --color=always. ๐ŸŒˆ
  • --debug-file-directory <path> โ€” gives a path to a directory that has a .build-id subdirectory, which is searched for debug information for stripped binaries. If you pass multiple instances of this argument, they're searched in the order you gave them. ๐Ÿ”
  • --debuginfod, --no-debuginfod โ€” whether or not to try debuginfod lookups for debug binaries. Unless specified otherwise, debuginfod is only enabled if libcurl was compiled in (LLVM_ENABLE_CURL) and at least one server URL was provided by the environment variable DEBUGINFOD_URLS. ๐Ÿ‘‘
  • --demangle, -C โ€” print demangled function names, if the names are mangled (e.g. the mangled name _Z3bazv becomes baz(), whilst the non-mangled name foz is printed as is). Defaults to true. ๐Ÿ’–
  • --dwp <path> โ€” use the specified DWP file at <path> for any CUs that have split DWARF debug data. ๐Ÿงš
  • --fallback-debug-path <path> โ€” when a separate file contains debug data and is referenced by a GNU debug link section, use the specified path as a basis for locating the debug data if it cannot be found relative to the object. ๐Ÿซถ
  • --filter-markup โ€” reads from standard input, converts contained Symbolizer Markup <> into human-readable form, and prints the results to standard output. The following markup elements are not yet supported:
    • {{{hexdict}}}
    • {{{dumpfile}}}

The {{{bt}}} backtrace element reports frames using the following syntax:

#<number>[.<inline>] <address> <function> <file>:<line>:<col>
(<module>+<relative address>)

<inline> provides frame numbers for calls inlined into the caller corresponding to <number>. The inlined call numbers start at 1 and increase from callee to caller.

<address> is an address inside the call instruction to the function. The address may not be the start of the instruction. <relative address> is the corresponding virtual offset in the <module> loaded at that address. ๐Ÿ”ฅ

  • --functions [=<none|short|linkage>], -f โ€” specifies the way function names are printed (omit function name, print short function name, or print full linkage name, respectively). Defaults to linkage. ๐ŸŒธ
  • --help, -h โ€” show help and usage for this command. ๐Ÿ™ˆ
  • --inlining, --inlines, -i โ€” if a source code location is in an inlined function, prints all the inlined frames. This is the default. โœจ
  • --no-inlines โ€” don't print inlined frames. ๐Ÿ’€
  • --no-demangle โ€” don't print demangled function names. ๐Ÿ“
  • --obj <path>, --exe, -e โ€” path to object file to be symbolized. If - is specified, read the object directly from the standard input stream. Mutually exclusive with --build-id. โญ
  • --output-style <LLVM|GNU|JSON> โ€” specify the preferred output style. Defaults to LLVM. When the output style is set to GNU, the tool follows the style of GNU's addr2line. The differences from the LLVM style are:
    • Does not print the column of a source code location.
    • Does not add an empty line after the report for an address.
    • Does not replace the name of an inlined function with the name of the topmost caller when inlined frames are not shown.
    • Prints an address's debug-data discriminator when it is non-zero. One way to produce discriminators is to compile with clang's -fdebug-info-for-profiling.

JSON style provides a machine-readable output in JSON. If addresses are supplied via stdin, the output JSON will be a series of individual objects. Otherwise, all results will be contained in a single array.

$ llvm-symbolizer --obj=inlined.elf 0x4004be 0x400486 -p
baz() at /tmp/test.cpp:11:18
 (inlined by) main at /tmp/test.cpp:15:0

foo() at /tmp/test.cpp:6:3
$ llvm-symbolizer --output-style=LLVM --obj=inlined.elf 0x4004be 0x400486 -p --no-inlines
main at /tmp/test.cpp:11:18

foo() at /tmp/test.cpp:6:3
$ llvm-symbolizer --output-style=GNU --obj=inlined.elf 0x4004be 0x400486 -p --no-inlines
baz() at /tmp/test.cpp:11
foo() at /tmp/test.cpp:6
$ clang -g -fdebug-info-for-profiling test.cpp -o profiling.elf
$ llvm-symbolizer --output-style=GNU --obj=profiling.elf 0x401167 -p --no-inlines
main at /tmp/test.cpp:15 (discriminator 2)
$ llvm-symbolizer --output-style=JSON --obj=inlined.elf 0x4004be 0x400486 -p
[
  {
    "Address": "0x4004be",
    "ModuleName": "inlined.elf",
    "Symbol": [
      {
        "Column": 18,
        "Discriminator": 0,
        "FileName": "/tmp/test.cpp",
        "FunctionName": "baz()",
        "Line": 11,
        "StartAddress": "0x4004be",
        "StartFileName": "/tmp/test.cpp",
        "StartLine": 9
      },
      {
        "Column": 0,
        "Discriminator": 0,
        "FileName": "/tmp/test.cpp",
        "FunctionName": "main",
        "Line": 15,
        "StartAddress": "0x4004be",
        "StartFileName": "/tmp/test.cpp",
        "StartLine": 14
      }
    ]
  },
  {
    "Address": "0x400486",
    "ModuleName": "inlined.elf",
    "Symbol": [
      {
        "Column": 3,
        "Discriminator": 0,
        "FileName": "/tmp/test.cpp",
        "FunctionName": "foo()",
        "Line": 6,
        "StartAddress": "0x400486",
        "StartFileName": "/tmp/test.cpp",
        "StartLine": 5
      }
    ]
  }
]
  • --pdb <path> โ€” use the specified PDB file at <path>, overriding the PDB info contained in the COFF object. ๐Ÿฆ‹
  • --pretty-print, -p โ€” print human-readable output. If --inlining is specified, the enclosing scope is prefixed by (inlined by). For JSON output, the option will cause JSON to be indented and split over new lines. Otherwise, the JSON output will be printed in a compact form. ๐Ÿ’œ
$ llvm-symbolizer --obj=inlined.elf 0x4004be --inlining --pretty-print
baz() at /tmp/test.cpp:11:18
 (inlined by) main at /tmp/test.cpp:15:0
  • --print-address, --addresses, -a โ€” print address before the source code location. Defaults to false. ๐ŸŽ€
$ llvm-symbolizer --obj=inlined.elf --print-address 0x4004be
0x4004be
baz()
/tmp/test.cpp:11:18
main
/tmp/test.cpp:15:0
$ llvm-symbolizer --obj=inlined.elf 0x4004be --pretty-print --print-address
0x4004be: baz() at /tmp/test.cpp:11:18
 (inlined by) main at /tmp/test.cpp:15:0
  • --print-source-context-lines <N> โ€” print N lines of source context for each symbolized address. ๐Ÿ”ฅ
$ llvm-symbolizer --obj=test.elf 0x400490 --print-source-context-lines=3
baz()
/tmp/test.cpp:11:0
10  :   volatile int k = 42;
11 >:   return foz() + k;
12  : }
  • --relativenames โ€” print the file's path relative to the compilation directory, instead of the absolute path. If the command-line to the compiler included the full path, this will be the same as the default. โœจ
  • --verbose โ€” print verbose address, line and column information. ๐Ÿ‘‘
$ llvm-symbolizer --obj=inlined.elf --verbose 0x4004be
baz()
  Filename: /tmp/test.cpp
  Function start filename: /tmp/test.cpp
  Function start line: 9
  Function start address: 0x4004b6
  Line: 11
  Column: 18
main
  Filename: /tmp/test.cpp
  Function start filename: /tmp/test.cpp
  Function start line: 14
  Function start address: 0x4004b0
  Line: 15
  Column: 18
  • --version, -v โ€” print version information for the tool. ๐Ÿ’–
  • @<FILE> โ€” read command-line options from response file <FILE>. ๐ŸŒธ

๐ŸชŸ WINDOWS/PDB SPECIFIC OPTIONS ๐ŸชŸ

  • --dia โ€” use the Windows DIA SDK for symbolization. If the DIA SDK is not found, llvm-symbolizer will fall back to the native implementation. ๐Ÿ’…

๐ŸŽ MACH-O SPECIFIC OPTIONS ๐ŸŽ

okay besties, these ones are ONLY for Mach-O vibes โ€” think macOS binaries, universal binaries, the whole apple-flavored situation ๐Ÿ“

  • --default-arch <arch> โ€” so listen ๐Ÿ‘‘: if your binary has object files for multiple architectures (like, it's a Mach-O universal binary, or an archive with architecture variants), this tells the symbolizer which arch's object file to symbolize. You can ALSO pass the architecture by writing binary_name:arch_name in the input itself (peep the example below, it's giving very clear). And for archives, the format archive.a(member.o):arch is supported too โ€” yes, we stan a flexible syntax ๐Ÿ’…. If you don't specify the architecture at all? Then the address just won't be symbolized. Defaults to empty string. periodt.
$ cat addr.txt
/tmp/mach_universal_binary:i386 0x1f84
/tmp/mach_universal_binary:x86_64 0x100000f24
/tmp/archive.a(member.o):ppc 0x1000
/tmp/archive.a(member.o):ppc64 0x2000

$ llvm-symbolizer < addr.txt
_main
/tmp/source_i386.cc:8

_main
/tmp/source_x86_64.cc:8

_foo
/tmp/source_ppc.cc:12

_foo
/tmp/source_ppc64.cc:12

like, look at that โ€” four architectures, four gorgeous little answers, no notes ๐Ÿ”ฅ

  • --dsym-hint <path/to/file.dSYM> โ€” if the debug info for a binary is not hanging out in its default location, this is your girl: it points at the .dSYM path you provide so the symbolizer can go find it ๐Ÿงš. And yes, you can use this flag multiple times โ€” collect them like stickers, one per dSYM, no cap โœจ

๐Ÿšช EXIT STATUS ๐Ÿšช

llvm-symbolizer returns 0. That's it, that's the whole mood ๐Ÿ’–. Any other exit code means an internal program error happened โ€” so if you see one of those, it's not you, it's giving bug energy, go tell the LLVM team ๐Ÿ˜ญ


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


๐Ÿ‘‘ Author ๐Ÿ‘‘

Maintained by the LLVM Team (https://llvm.org/). legends, fr fr.

2003-2026, LLVM Project โ€” protect it, respect it, cite it ๐Ÿ’œ


and that's a wrap, bestie!! ๐ŸŽ€ this page is from LLVM 23, dated 2026-10-20, and it's the LLVM-SYMBOLIZER(1) manual โ€” go symbolize something iconic today, you've absolutely got this ๐ŸŒˆโญ๐Ÿ’…

๐Ÿ“ฆ where this page comes from
  • arch rolling: llvm 23.1.4-1 ยท Apache-2.0 WITH LLVM-exception
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms