5.2 Objdump

The avr-objdump application can display various information about object files.

The general form of the tool’s command line is as follows:

avr-objdump [options] objfiles

where objfiles can be any object file, including an archive or output file. The tool is able to determine the format of the file specified.

The --help option shows all the command available for this application.

For AVR ELF files only, the -Pmem-usage option will show program and data memory usage in bytes and as a percentage of the memory space available.

A common usage of this tool is to obtain a full list file for the entire program. To do this, use the compiler’s -g option when you build the project, then call the avr-objdump application with a command similar to the following.

avr-objdump -S -l a.out > avr.lst

This will create an avr.lst listing file from the default compiler output file, showing the original C source code and line number information in the listing.