Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/analogdevicesinc/codefusion-studio/llms.txt

Use this file to discover all available pages before exploring further.

The cfsutil elf commands provide structured access to information embedded in ELF (Executable and Linkable Format) firmware binaries. After building your embedded application, you can use these commands to verify memory usage, inspect section layouts, locate symbols by address, and extract header metadata — all without a debugger or IDE. The --format json flag on every command makes it straightforward to integrate ELF analysis into CI pipelines or post-build scripts.
The --json flag was deprecated in CFS 2.2.0. Use --format json instead for all ELF commands.

cfsutil elf analyze

cfsutil elf analyze <FILEPATH> [--format text|json]
Provides a high-level summary of the ELF file including platform, stack and heap sizes, and flash/SRAM sizes. This is the quickest way to verify that a firmware image fits within hardware memory constraints.
Argument / FlagDescription
<FILEPATH>Required. Path to the ELF file
--formatOutput format: text (default) or json
cfsutil elf analyze firmware.elf
cfsutil elf analyze firmware.elf --format json

cfsutil elf info

cfsutil elf info <FILEPATH> [--format text|json] [-h] [-a] [-c] [-s] [-v]
Provides detailed information about the ELF file. At least one of the content switches (-h, -a, -c, -s) is required. Switches can be combined.

Flag reference

FlagShortDescription
<FILEPATH>Required. Path to the ELF file
--header-hShow ELF header information
--attributes-aShow ELF attributes
--core-cShow core information about the ELF file
--fsize-sShow section size information
--formatOutput format: text (default) or json
--verbose-vEnable verbose output
# Show ELF header
cfsutil elf info firmware.elf -h

# Show header and size
cfsutil elf info firmware.elf -h -s

# Show all sections with verbose output
cfsutil elf info firmware.elf -a -c -s -v

# JSON output for CI parsing
cfsutil elf info firmware.elf -h -s --format json

cfsutil elf memory

cfsutil elf memory <FILEPATH> [-s] [-t] [-y] [-i <value>] [-n <value>] [--format text|json] [-d]
Provides information on symbols, sections, and segments within the ELF file. Choose at least one of -s, -t, or -y.

Flag reference

FlagShortDescription
<FILEPATH>Required. Path to the ELF file
--segment-sList all segments
--section-tList sections within each segment
--symbol-yList symbols within each section
--detail-dPrint detailed information. Must be used with -s, -t, or -y
--id-iDisplay from the section or segment with the given ID
--name-nDisplay from the section or segment with the given name
--formatOutput format: text (default) or json. Must be used with -s, -t, or -y
# List all segments
cfsutil elf memory firmware.elf -s

# List sections in each segment
cfsutil elf memory firmware.elf -t

# List symbols in each section
cfsutil elf memory firmware.elf -y

# Detailed segment listing
cfsutil elf memory firmware.elf -s -d

# Sections only for a specific segment by name
cfsutil elf memory firmware.elf -t -n .text

# Sections only for a specific segment by ID
cfsutil elf memory firmware.elf -t -i 2

# Symbols in a named section
cfsutil elf memory firmware.elf -y -n .data

# JSON output for scripting
cfsutil elf memory firmware.elf -t --format json
For -t and -y, results can be restricted to a specific segment or section using -i (by ID) or -n (by name). This command can generate large output — consider redirecting to a file: cfsutil elf memory firmware.elf -y > symbols.txt

cfsutil elf symbols

cfsutil elf symbols <FILEPATH> <SQLQUERY> [--format text|json] [-f]
Runs a SQL query against the symbol table of the ELF file. This provides flexible, powerful filtering and sorting beyond what fixed flags can offer.

Symbol table schema

The query targets a table named symbols with the following fields:
FieldTypeDescription
nametextSymbol name
typetextSymbol type: None, Object, Function, or Filename
addressintegerStart address of the symbol
sectiontextSection containing the symbol
sizeintegerSize of the symbol in bytes
bindtextBinding type: Weak, Local, or Global
visibilitytextVisibility: Default or Hidden
pathtextSource file path (if debug info is available)

Flags

FlagShortDescription
<FILEPATH>Required. Path to the ELF file
<SQLQUERY>Required. SQL query string to run against the symbols table
--formatOutput format: text (default) or json
--full-fPrint full source file path (if debug info is available)

Example queries

# Select all symbols
cfsutil elf symbols firmware.elf "SELECT * FROM symbols"

# Select only name and address columns
cfsutil elf symbols firmware.elf "SELECT name, address FROM symbols"

# Symbols larger than 100 bytes
cfsutil elf symbols firmware.elf "SELECT * FROM symbols WHERE size > 100"

# Ten largest symbols by size
cfsutil elf symbols firmware.elf "SELECT * FROM symbols ORDER BY size DESC LIMIT 10"

# Symbols within an address range
cfsutil elf symbols firmware.elf \
  "SELECT * FROM symbols WHERE address BETWEEN 0x10000000 AND 0x20000000"

# Function symbols only
cfsutil elf symbols firmware.elf "SELECT * FROM symbols WHERE type = 'Function'"

# Symbols matching a name pattern (LIKE)
cfsutil elf symbols firmware.elf "SELECT * FROM symbols WHERE name LIKE 'ADI_%'"

# JSON output for CI integration
cfsutil elf symbols firmware.elf "SELECT * FROM symbols ORDER BY size DESC LIMIT 10" --format json

# Include full source file paths
cfsutil elf symbols firmware.elf "SELECT name, path, size FROM symbols WHERE size > 0" -f

CI integration example

The following example shows how to use ELF analysis as a post-build step in a CI pipeline to assert that the firmware fits within memory constraints.
# Build the firmware (via tasks run or direct toolchain call)
cfsutil tasks run build -w /ci/workspace -p m4

# Extract memory summary as JSON and check flash usage
cfsutil elf analyze /ci/workspace/m4/build/firmware.elf --format json > analysis.json

# Find the ten largest symbols for review
cfsutil elf symbols /ci/workspace/m4/build/firmware.elf \
  "SELECT name, size, section FROM symbols ORDER BY size DESC LIMIT 10" \
  --format json > top_symbols.json

Build docs developers (and LLMs) love