DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

dump(CP)


dump -- dump selected parts of an object file

Syntax

dump options files

Description

The dump(CP) command outputs selected parts of each of its input object files. The output can be directed via the standard redirection tools.

dump command accepts both object files and archives of object files, and can operate on both COFF and ELF object files. dump scans each input file to determine its file format and executes the appropriate binary. The file format of the first module in an archive library is used as the file format for all modules in that library. Use the modifier -b to force dump to use a particular file format.

Certain options and modifiers described here are applicable to only either ELF or COFF file format, not both. ELF only options and modifiers may only be used when either at least one input file is in ELF format, or when the modifier -b elf is used; COFF only options and modifiers may only be used when either all input files are in COFF format, or when any one of the modifiers -b coff and -b ibcs2 is used.

Options

At least one option must be specified. dump processes each file argument according to one or more of the following options:


-a
Dump the archive header of each member of each archive file argument.

-c
Dump the string table.

-C
Dump decoded C++ symbol table names.

-D
Dump debugging information.

-f
Dump each file header.

-g
Dump the global symbols in the symbol table of an archive.

-h
Dump section headers.

-L
Dump dynamic linking information and static shared library information (the contents of the .lib sections), if available.

-l
Dump line number information.

-o
Dump each optional header.

-r
Dump relocation information.

-s
Dump section contents.

-t
Dump symbol table entries.

-T index
-T index1,index2
Dump only the indexed symbol table entry defined by index or a range of entries defined by index1,index2. This is an ELF only option.

-V
Print the dump version number.

-z name
Dump line number entries for the named function.

Modifiers

The following modifiers are used with the options listed above to modify their capabilities. Using them without at least one option produces no useful output.


-b format
Do not scan input object files. Use format as the file format for all files. format can be any one of elf, coff and ibcs2. ibcs2 is equivalent to coff. The case of format is not significant.

-d number
-d number1,number2
Dump the section number indicated by number or the range of sections starting at number1 and ending at number2. This modifier can be used with -h, -s, and -r. When -d is used with -h or -s, the argument is treated as the number of a section or range of sections. When -d is used with -r, the argument is treated as the number of the section or range of sections to which the relocation applies. For example, to print out all relocation entries associated with the .text section, specify the number of the section as the argument to -d. If .text is section number 2 in the file, dump -r -d 2 prints all associated entries. To print out a specific relocation section use dump -s -n name for raw data output, or dump -sv -n name for interpreted output.

One form of this modifer, -d number1,number2, is ELF only.


+d number
Dump sections in the range either beginning with first the section or beginning with the section specified by -d. This is a COFF only modifer. See -d number1,number2 above for its ELF equivalent.

-n name
When -n is used with -h or -s, the argument will be treated as the name of a section. When -n is used with -t or -r, the argument will be treated as the name of a symbol. For example, dump -t -n .text will dump the symbol table entry associated with the symbol whose name is .text, where dump -h -n .text will dump the section header information for the .text section.

-p
Suppress printing the headers.

-t index
Dump only the indexed symbol table entry. The -t, used in conjunction with +t, specifies a range of symbol table entries. This is a COFF only modifer.

+t index
Dump the symbol table entries in the range ending with the indexed entry. The range begins at the first symbol table entry or at the entry specified by the -t option. This is a COFF only modifer. See -T index1,index2 in ``Options'' for its ELF equivalent.

-u
This modifier modifies dump differently depending on the file format that dump uses:

COFF
Underline the name of the file for emphasis.

ELF
When reading a COFF object file, dump translates the file to ELF internally (this translation does not affect the file contents). This option controls how much translation occurs from COFF values to ELF. Normally (without -u), the COFF values are preserved as much as possible, showing the actual bytes in the file. If -u is used, dump updates the values and completes the internal translation, giving a consistent ELF view of the contents. Although the bytes displayed under this option might not match the file itself, they show how the file would look if it were converted to ELF. See cof2elf(CP) for more information.

-v
Dump information in symbolic representation rather than numeric. This modifier modifies dump differently and can be combined with a different set of options depending on the file format that dump uses:

COFF
-v can be used with all the above options except -o and -s.

ELF
-v can be used with

  • -a (date, user id, group id)

  • -f (class, data, type, machine, version, flags)

  • -h (type, flags)

  • -o (type, flags)

  • -r (name, type)

  • -s (interpret section contents wherever possible)

  • -t (type, bind)

  • -L (value)
When -v is used with -s, all sections that can be interpreted, such as the string table or symbol table, will be interpreted. For example, dump -sv -n .symtab file will produce the same formatted output as dump -tv file, but dump -s -n .symtab file will print raw data in hexadecimal. Without additional modifiers, dump -sv file will dump all sections in file, interpreting all those that it can and dumping the rest (such as .text or .data) as raw data.

-z name,number
Dump line number entry or range of line numbers starting at number for the named function. The comma separating the name from the number modifying the -z option can be replaced by a blank. This is a COFF only modifer.

+z number
Dump line numbers starting at either function name or number specified by -z, up to number specified by +z. This is a COFF only modifer.

Blanks separating an option and its modifier are optional.

dump tries to format the information in a meaningful way, printing certain information in character, hexadecimal, octal, or decimal representation as appropriate.

See also

a.out(FP), ar(FP), cof2elf(CP), nm(CP)

Standards conformance

dump is not part of any currently supported standard; it is an extension that is maintained by The SCO Group.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003