$ xref sym
On this page
List function symbols whose name contains a pattern. Useful only on binaries that still carry a symbol table; stripped release binaries have none (use refs, where or find there).
Usage
xref sym <PATTERN>
Arguments and options
Arguments
<PATTERN>Examples
Find a function by part of its name
The xref 0.4.0 release binary is not stripped, so its Rust symbols (mangled _RNv… names) can be searched:
$ xref -b xref-0.4.0 sym field_by_keys
0x355940 _RNvNtCs1SrNGm53fEm_4xref12serde_fields13field_by_keys 1 symbols
xref: load 2.9ms, total 3.0ms
Each line is the function start address and its raw linker name; the last line counts the matches. Pass the address to c, asm or card.
On a stripped binary
$ xref -b rg sym main
0 symbols
xref: load 2.4ms, total 2.4ms
A stripped binary has no symbol table, so nothing is found.
Limits
- Names are matched as raw bytes of the linker symbol (mangled for Rust and C++), not demangled.
- Only symbols that the image keeps are searched; stripped binaries return none.
Provenance
Recorded with a development build of xref after 0.4.0 on Linux x86-64, on rg = ripgrep 14.1.1 (official stripped release); xref-0.4.0 = the xref 0.4.0 Linux release binary (not stripped). Output is unchanged except that whitespace at the end of each line and empty lines at the end of the output are removed; long outputs are cut where marked.
Source: docs/cli/sym.md · generated for the site; edit the Markdown, not this page.