MSP430 Assembly Language Tools v15.12.0.LTS User's Guide
SLAU131L - REVISED JANUARY 2016

11 Object File Utilities

This chapter describes how to invoke the following utilities:

  • The object file display utility prints the contents of object files, executable files, and/or archive libraries in both text and XML formats.
  • The disassembler accepts object files and executable files as input and produces an assembly listing as output. This listing shows assembly instructions, their opcodes, and the section program counter values.
  • The name utility prints a list of names defined and referenced in an object file, executable files, and/or archive libraries.
  • The strip utility removes symbol table and debugging information from object and executable files.

11.1 Invoking the Object File Display Utility

The object file display utility, ofd430, prints the contents of object files (.obj), executable files (.out), and/or archive libraries (.lib) in both text and XML formats. Hidden symbols are listed as no name, while localized symbols are listed like any other local symbol.

To invoke the object file display utility, enter the following:

ofd430 [options] input filename [input filename]
ofd430 is the command that invokes the object file display utility.
input filename names the object file (.obj), executable file (.out), or archive library (.lib) source file. The filename must contain an extension.
options identify the object file display utility options that you want to use. Options are not case sensitive and can appear anywhere on the command line following the command. Precede each option with a hyphen.
-cg Prints function stack usage and callee information in XML format. While the XML output may be accessed by a developer, this option was primarily designed to be used by tools such as Code Composer Studio to display an application’s worst case stack usage.
--dwarf_display=attributes Controls the DWARF display filter settings by specifying a comma-delimited list of attributes. When prefixed with no, an attribute is disabled instead of enabled.
Examples: --dwarf_display=nodabbrev,nodline
--dwarf_display=all,nodabbrev
--dwarf_display=none,dinfo,types
The ordering of attributes is important (see --obj_display). The list of available display attributes can be obtained by invoking ofd430 --dwarf_display=help.
-g Appends DWARF debug information to program output.
-h Displays help
-o=filename Sends program output to filename rather than to the screen.
--obj_displayattributes Controls the object file display filter settings by specifying a comma-delimited list of attributes. When prefixed with no, an attribute is disabled instead of enabled.
Examples: --obj_display=rawdata,nostrings
--obj_display=all,norawdata
--obj_display=none,header
The ordering of attributes is important. For instance, in "--obj_display=none,header", ofd430 disables all output, then re-enables file header information. If the attributes are specified in the reverse order, (header,none), the file header is enabled, the all output is disabled, including the file header. Thus, nothing is printed to the screen for the given files. The list of available display attributes can be obtained by invoking ofd430 --obj_display=help.
-v Prints verbose text output.
-x Displays output in XML format.
--xml_indent=num Sets the number of spaces to indent nested XML tags.

If an archive file is given as input to the object file display utility, each object file member of the archive is processed as if it was passed on the command line. The object file members are processed in the order in which they appear in the archive file.

If the object file display utility is invoked without any options, it displays information about the contents of the input files on the console screen.

NOTE

Object File Display Format

The object file display utility produces data in a text format by default. This data is not intended to be used as input to programs for further processing of the information. XML format should be used for mechanical processing.

11.2 Invoking the Disassembler

The disassembler, dis430, examines the output of the assembler or linker. This utility accepts an object file or executable file as input and writes the disassembled object code to standard output or a specified file.

To invoke the disassembler, enter the following:

dis430[options] input filename[.] [output filename]
dis430 is the command that invokes the disassembler.
options identifies the name utility options you want to use. Options are not case sensitive and can appear anywhere on the command line following the invocation. Precede each option with a hyphen (-). The name utility options are as follows:
-a disables the display of the branch destination address along with label names within instructions.
-b displays data as bytes instead of words.
-c dumps the object file information.
-d disables display of data sections.
-h shows the current help screen.
-i disassembles .data sections as instructions.
-I disassembles .text sections as data.
-q (quiet mode) suppresses the banner and all progress information.
-qq (super quiet mode) suppresses all headers.
-r uses raw register IDs (R10, R11, etc.).
-R shows run-time address if different from load-time address.
-s suppresses printing of opcode and section program counter in the listing. When you use this option along with –qq, the disassembly listing looks like the original assembly source file.
-t suppresses the display of text sections in the listing.
input filename[.ext] is the name of the input file. If the optional extension is not specified, the file is searched for in this order:

  1. infile
  2. infile.out, an executable file
  3. infile.obj, an object file
output filename is the name of the optional output file to which the disassembly will be written. If an output filename is not specified, the disassembly is written to standard output.

11.3 Invoking the Name Utility

The name utility, nm430, prints the list of names defined and referenced in an object file, executable file, or archive library. It also prints the symbol value and an indication of the kind of symbol. Hidden symbols are listed as "".

To invoke the name utility, enter the following:

nm430 [-options] [input filenames]
nm430 is the command that invokes the name utility.
input filename is an object file (.obj), executable file (.out), or archive library (.lib).
options identifies the name utility options you want to use. Options are not case sensitive and can appear anywhere on the command line following the invocation. Precede each option with a hyphen (-). The name utility options are as follows:
-a prints all symbols.
-f prepends file name to each symbol.
-g prints only global symbols.
-h shows the current help screen.
-l produces a detailed listing of the symbol information.
-n sorts symbols numerically rather than alphabetically.
-o file outputs to the given file.
-p causes the name utility to not sort any symbols.
-q (quiet mode) suppresses the banner and all progress information.
-r sorts symbols in reverse order.
-s lists symbols in the dynamic symbol table for an ELF object module.
-u only prints undefined symbols.

11.4 Invoking the Strip Utility

The strip utility, strip430, removes symbol table and debugging information from object and executable files.

To invoke the strip utility, enter the following:

strip430 [-p] input filename [input filename]
strip430 is the command that invokes the strip utility.
input filename is an object file (.obj) or an executable file (.out).
options identifies the strip utility options you want to use. Options are not case sensitive and can appear anywhere on the command line following the invocation. Precede each option with a hyphen (-). The strip utility option is as follows:
-o filename writes the stripped output to filename.
-p removes all information not required for execution. This option causes more information to be removed than the default behavior, but the object file is left in a state that cannot be linked. This option should be used only with executable (.out) files.
When the strip utility is invoked without the -o option, the input object files are replaced with the stripped version.
Submit Documentation Feedback

Copyright© 2016, Texas Instruments Incorporated. An IMPORTANT NOTICE for this document addresses availability, warranty, changes, use in safety-critical applications, intellectual property matters and other important disclaimers.