TMS320C28x Assembly Language
Tools
v15.12.0.LTS User's Guide
SPRU513J - 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, ofd2000, 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:
ofd2000 [options] input filename [input filename] |
ofd2000 | 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 ofd2000 --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", ofd2000 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 ofd2000 --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 FormatThe 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, dis2000, 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:
dis2000input filename[.] [output filename] |
dis2000 | is the command that invokes the disassembler. | |
input filename[.ext] | is a COFF object file (.obj) or an executable file (.out). | |
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, nm2000, 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:
nm2000 [-options] [input filenames] |
nm2000 | 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. | |
-c | also prints C_NULL symbols for a COFF object module. | |
-d | also prints debug symbols for a COFF object module. | |
-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. | |
-t | also prints tag information symbols for a COFF object module. | |
-u | only prints undefined symbols. |
11.4 Invoking the Strip Utility
The strip utility, strip2000, removes symbol table and debugging information from object and executable files.
To invoke the strip utility, enter the following:
strip2000 [-p] input filename [input filename] |
strip2000 | 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 static executable or dynamic object module files. | |
When the strip utility is invoked without the -o option, the input object files are replaced with the stripped version. |
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.