TMS320C6000 Assembly Language
Tools
v8.2.x User's Guide
SPRUI03B - REVISED MAY 2017
9 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.
9.1 Invoking the Object File Display Utility
The object file display utility, ofd6x, 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:
ofd6x [options] input filename [input filename] |
ofd6x | 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 ofd6x --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", ofd6x 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 ofd6x --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.
9.2 Invoking the Disassembler
The disassembler, dis6x, 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:
dis6x[options] input filename[.] [output filename] |
dis6x | 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 printing of branch destination addresses along with labels. | |
-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. | |
-l | disassembles data sections as text. | |
-n | suppresses FP header information for C64x+ Compact FPs. | |
-o ## | disassembles single word ## or 0x## then exits. | |
-q | (quiet mode) suppresses the banner and all progress information. | |
(super quiet mode) suppresses all headers. | ||
-s | suppresses printing of address and data words. | |
-t | suppresses the display of text sections in the listing. | |
-v | displays family of the target. | |
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:
|
|
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. |
9.3 Invoking the Name Utility
The name utility, nm6x, 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:
nm6x [-options] [input filenames] |
nm6x | 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. |
9.4 Invoking the Strip Utility
The strip utility, strip6x, removes symbol table and debugging information from object and executable files.
To invoke the strip utility, enter the following:
strip6x [-p] input filename [input filename] |
strip6x | 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© 2017, 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.