| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 1: User Commands Oracle Solaris 11 Information Library |
- dumps selected parts of an object file
elfdump [-cCdegGhHiklmnPrsSuvy] [-p | -w file] [-Iindex-expr] [-Nname] [-Oosabi] [-Ttype]filename...
Theelfdump utility symbolically dumps selected parts of the specified object file(s).The options allow specific portions of the file to be displayed.
Theelfdump utility is similar in function to thedump(1) utility. Thedump utility offers an older and less user-friendly interface thanelfdump, althoughdumpmight be more appropriate for certain uses such as in shell scripts.
Archive files, produced byar(1), can also be inspected withelfdump. Inthis case, each object within the archive is processed using the options supplied.
elfdump can display the ELF header, program header array, and section headerarray for any ELF object. It is also able to display thedata found in the following types of sections:
Category Option ELF Section TypeDynamic -d SHT_DYNAMICGlobal Offset Table (GOT) -G Special. See below.Group -g SHT_GROUPCapabilities -H SHT_SUNW_capHash Table -h SHT_HASHInterpreter -i Special, see below.Move -m SHT_SUNW_moveNote -n SHT_NOTERelocation -r SHT_RELA SHT_RELStack Unwind/Exceptions -u Special. See below.Syminfo -y SHT_SUNW_syminfoSymbol Sort -S SHT_SUNW_symsort SHT_SUNW_tlssortSymbol Table -s SHT_SYMTAB SHT_DYNSYM SHT_SUNW_LDYNSYM SHT_SUNW_versymVersioning -v SHT_SUNW_verdef SHT_SUNW_verneed
Interpreter and global offset table sections do not have a special ELFsection type, but are instead implemented asSHT_PROGBITS sections with well knownnames (.interp and.got respectively).elfdump is able to recognize and display thesespecial sections.
Sections used for stack unwinding and exception handling can have the ELFsection typeSHT_PROGBITS, orSHT_AMD64_UNWIND, depending on the compiler and platform involved.These sections are recognized by name:.eh_frame,.eh_frame_hdr, and.exception_ranges.
When run without options to narrow the information displayed,elfdump displays allavailable information for each object.
For a complete description of the displayed information, refer to theLinker and Libraries Guide.
The following options are supported:
Dumps section header information.
Demangles C++ symbol names.
Dumps the contents of the.dynamic section.
Dumps the ELF header.
Dumps the contents of the.group section.
Dumps the contents of the.got section.
Dumps the contents of the.hash section.
Dumps the contents of the.SUNW_cap capabilities section.
Dumps the contents of the.interp section.
Qualifies the sections or program headers to examine with a specific index or index range. For example, the third section header in a file can be displayed using:
example%elfdump -c -I 3filename
Anindex-expr can be a single non-negative integer value that specifies a specific item, as shown in the previous example. Alternatively, anindex-expr can consist of two such values separated by a colon (:), indicating a range of items. The following example displays the third, fourth, and fifth program headers in a file:
example%elfdump -p -I 3:5filename
When specifying an index range, the second value can be omitted to indicate the final item in the file. For example, the following statement lists all section headers from the tenth to the end:
example%elfdump -c -I 10:filename
See Matching Options for additional information about the matching options (-I,-N,-T).
Calculates the ELF checksum. Seegelf_checksum(3ELF).
Displays long section names without truncation.
Dumps the contents of the.SUNW_move section.
Dumps the contents of.note sections. By default,elfdump displays this data without interpretation in hexadecimal form. Core files are an exception. A subset of the core file notes described incore(4) are interpreted byelfdump and displayed in a high level format: NT_PRSTATUS, NT_PRPSINFO, NT_PLATFORM, NT_AUXV, NT_ASRS, NT_PSTATUS, NT_PSINFO, NT_PRCRED, NT_UTSNAME, NT_LWPSTATUS, NT_LWPSINFO, NT_PRPRIV, NT_PRPRIVINFO, NT_CONTENT, and NT_ZONENAME.
Qualifies the sections or program headers to examine with a specific name. For example, in a file that contains more than one symbol table, the.dynsym symbol table can be displayed by itself using:
example%elfdump -N .dynsymfilename
ELF program headers do not have names. If the-p option is specified,name refers to the program header type, and the behavior of the-N option is identical to that of the-T option. For example, the program header that identifies an interpreter can be displayed using:
example%elfdump -p -N PT_INTERPfilename
See Matching Options for additional information about the matching options (-I,-N,-T).
Specifies the Operating System ABI to apply when interpreting the object.osabi can be the name or value of any of theELFOSABI_ constants found in/usr/include/sys/elf.h. For convenience, theELFOSABI_ prefix may be omitted from these names. Twoosabi values are fully supported:solaris is the native ABI of the Solaris operating system.none is the generic ELF ABI. Support for other operating system ABIs may be incomplete or missing. Items for which strings are unavailable are displayed in numeric form.
If-O is not used, and the object ELF header specifies a non-generic ABI, the ABI specified by the object is used. If the object specifies the generic ELF ABI,elfdump searches for a.note.ABI-tag section, and if found, identifies the object as having thelinux ABI. Otherwise, an object that specifies the generic ELF ABI is assumed to conform to thesolaris ABI.
Dumps the program headers. Individual program headers can be specified using the matching options (-I,-N,-T). See Matching Options for additional information.
The-p and-w options are mutually exclusive. Only one of these options can be used in a givenelfdump invocation
Generate and use alternative section header information based on the information from the program headers, ignoring any section header information contained in the file. If the file has no section headers a warning message is printed and this option is automatically selected. Section headers are not used by the system to execute a program. As such, a malicious program can have its section headers stripped or altered to provide misleading information. In contrast the program headers must be accurate for the program to be runnable. The use of synthetic section header information derived from the program headers allows files with altered section headers to be examined.
Dumps the contents of the.rel[a] relocation sections.
Dumps the contents of the.SUNW_ldynsym,.dynsym, and.symtab symbol table sections. For archives, the archive symbol table is also dumped. Individual sections can be specified with the matching options (-I,-N,-T). An archive symbol table can be specified using the special section name-NARSYM.
In the case of core files, theshndx field has the value “unknown” since the field does not contain the valid values.
In addition to the standard symbol table information, the version definition index of the symbol is also provided under thever heading.
See Matching Options for additional information about the matching options (-I,-N,-T).
Dumps the contents of the.SUNW_ldynsym and.dynsym symbol table sections sorted in the order given by the.SUNW_dynsymsort and.SUNW_dyntlssort symbol sort sections. Thread Local Storage (TLS) symbols are sorted by offset. Regular symbols are sorted by address. Symbols not referenced by the sort sections are not displayed.
Qualifies the sections or program headers to examine with a specific type. For example, in a file that contains more than one symbol table, the.dynsym symbol table can be displayed by itself using:
example%elfdump -T SHT_DYNSYMfilename
The value oftype can be a numeric value, or any of theSHT_ symbolic names defined in/usr/include/sys/elf.h. TheSHT_ prefix is optional, andtype is case insensitive. Therefore, the above example can also be written as:
example%elfdump -T dynsymfilename
If the-p option is specified,type refers to the program header type, which allows for the display of specific program headers. For example, the program header that identifies an interpreter can be displayed using:
example%elfdump -p -T PT_INTERPfilename
The value oftype can be a numeric value, or any of thePT_ symbolic names defined in/usr/include/sys/elf.h. ThePT_ prefix is optional, andtype is case insensitive. Therefore, the above example can also be written as:
example%elfdump -p -T interpfilename
See Matching Options for additional information about the matching options (-I,-N,-T).
Dumps the contents of sections used for stack frame unwinding and exception processing.
Dumps the contents of the.SUNW_version version sections.
Writes the contents of sections which are specified with the matching options (-I,-N,-T) to the named file. For example, extracting the.text section of a file can be carried out with:
example%elfdump -w text.out -N .textfilename
See Matching Options for additional information about the matching options (-I,-N,-T).
The-p and-w options are mutually exclusive. Only one of these options can be used in a givenelfdump invocation
Dumps the contents of the.SUNW_syminfo section. Symbol attributes are conveyed by character tokens.
Symbol definition acts as an auxiliary filter.
Assigned withD, symbol reference should be directly bound to the associated dependency definition.
Symbol definition is the result of a copy-relocation.
Symbol reference has a direct association to a dependency containing the definition.
Symbol definition acts as a standard filter.
Symbol definition acts as an interposer.
Symbol reference is to a dependency that should be lazily loaded.
External references can not directly bind to this symbol definition.
Symbol is associated with deferred (postponed) dependency.
Symbol is associated with capabilities.
The following operand is supported:
The name of the specified object file.
The options-I,-N, and-T are collectively referred to as thematching options. These options are used to narrow the range of program headersor sections to examine, by index, name, or type.
The exact interpretation of the matching options depends on the other optionsused:
When used with the-p option, the matching options reference program headers.-I refers to program header indexes.-T refers to program header types. As program headers do not have names, the-N option behaves identically to-T for program headers.
The matching options are used to select sections by index, name, or type when used with any of the options-c,-g,-m,-n,-r,-s,-S,-u, or-w.
If matching options are used alone without any of the options-c,-g,-m,-n,-p-r,-s,-S,-u, or-w, thenelfdump examines each object, and displays the contents of any sections matched.
Any number and type of matching option can be mixed in agiven invocation ofelfdump. In this case,elfdump displays the superset ofall items matched by any of the matching options used. This featureallows for the selection of complex groupings of items using the most convenientform for specifying each item.
linker debugging library
Seeattributes(5) for descriptions of the following attributes:
|
ar(1),dump(1),elffile(1),file(1),nm(1),pvs(1),elf(3ELF),core(4),attributes(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |