XRef
Documentation menu
xrefcode.com / docs / cli / sym

$ xref sym

On this page
  1. Usage
  2. Arguments and options
  3. Examples
  4. Find a function by part of its name
  5. On a stripped binary
  6. Limits
  7. Provenance

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>
Substring of the raw (mangled) symbol name.

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:

Command
$ xref -b xref-0.4.0 sym field_by_keys
Output
0x355940  _RNvNtCs1SrNGm53fEm_4xref12serde_fields13field_by_keys
1 symbols
stderr
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

Command
$ xref -b rg sym main
Output
0 symbols
stderr
xref: load 2.4ms, total 2.4ms

A stripped binary has no symbol table, so nothing is found.

Limits

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.