How to Use objdump and the meaning of each column in symbol table

Source: Internet
Author: User

How to Use objdump and the meaning of each column in symbol table
I. Usage of objdump

Man manual of the objdump command

Objdump
[-A] [-B bfname |
-- Target = bfdname] [-C] [-- debugging]
[-D] [-D]
[-- Disassemble-zeroes]
[-EB |-EL | -- endian = {big | little}] [-f]
[-H] [-I | -- info]
[-J section | -- section = section]
[-L] [-m machine] [-- prefix-addresses]
[-R] [-R]
[-S | -- full-contents] [-S | -- source]
[-- [No-] show-raw-insn] [-- stabs] [-t]
[-T] [-x]
[-- Start-address = address] [-- stop-address = address]
[-- Adjust-vma = offset] [-- version] [-- help]
Objfile...

-- Archive-headers

-A: displays the member information of the archive, which is similar to that of ar TV.
Objdump-a libpcap.
Comparison with the ar-TV libpcap. a display result
Obviously, this option is meaningless.
-- Adjust-vma = offset
When dumping information, first add offset to all
The section addresses. This is useful if the sec-
Tion addresses do not correspond to the symbol
Table, which can happen when putting sections
Particle ses SSEs when using a format which can
Not represent section addresses, such as a. out.
-B bfdname
-- Target = bfdname
Specify the target format. This is not necessary. objdump can automatically recognize many formats,
For example: objdump-B oasys-m vax-h fu. o
Displays the summary of the fu. o header, explicitly indicating that the file is Oasys In the Vax system.
The target file generated by the compiler. Objdump-I will show what can be specified here
Target code format list
-- Demangle
-C decodes the underlying symbolic names into user-level names, except for removing all prefixes
In addition to the underline, the C ++ function name is displayed in an understandable way.
-- Debugging
Displays debugging information. Attempt to parse the debugging information stored in the file and use the C Language
. Only some types of debugging information are supported.
-- Disassemble
-D. disassemble the sections with the instruction machine code.
-- Disassemble-all
-D is similar to-d, but disassembles all sections.
-- Prefix-addresses
The complete address of each line is displayed during disassembly. This is an old disassembly format.
The display effect is not ideal, but some of them may be used for comparison.
-- Disassemble-zeroes
Generally, the zero part of the large part will be omitted in the disassembly output. This option will make the zero part be decompiled.
-EB
-EL
-- Endian = {big | little}
This option will affect the decompiling command.
Little-endian is what we often say when we were playing assembly under dos,
This is the case for x86.

-- File-headers
-F displays the overall header summary of each object in the objfile.

-- Section-headers
-- Headers
-H: displays the header summary of each section in the target file.

-- Help brief help information.

-- Info
-I displays the list of architectures and target formats available for-B or-m options.

-- Section = name
-J name only displays the information of the specified section.

-- Line-numbers
-L mark the target code with the file name and line number, and only use it with-d,-D, or-r.
The difference between using-ld and using-d is not great. It is useful in source code-level debugging and requires
Debugging and compilation options such as-g are used during compilation.

-- Architecture = machine
-M machine
The architecture used to specify the target file for disassembly.
This option is useful for architecture information (such as S-records. You can use the-I option.
List the architectures that can be specified here

-- Reloc
-R displays the relocation entry of the file. If it is used with-d or-D, the relocation part is reversed.
The edited format is displayed.

-- Dynamic-reloc
-R: displays the dynamic relocation entry of a file, which is only meaningful to the dynamic target file, for example, some
Shared library.

-- Full-contents
-S: displays the complete content of the specified section.

Objdump -- section =. text-s inet. o | more

-- Source
-S decomassembles the source code as much as possible, especially when the-g debugging parameter is specified during compilation,
The effect is obvious. The-d parameter is hidden.

-- Show-raw-insn
During disassembly, the machine code corresponding to each assembly instruction is displayed, unless
-- Prefix-addresses, which is the default option.

-- No-show-raw-insn
During disassembly, the machine code of the Assembly command is not displayed. This is the -- prefix-addresses parameter.
Option.

-- Stabs
Display the contents of the. stab,. stab. index, and
. Stab. excl sections from an ELF file. This is only
Useful on systems (such as Solaris 2.0) in which
. Stab debugging symbol-table entries are carried in
An ELF section. In most other file formats, debug-
Ging symbol-table entries are interleaved
Linkage symbols, and are visible in the -- syms output.

-- Start-address = address
Data is displayed from the specified address. This option affects the output of the-d,-r, and-s options.

-- Stop-address = address
Displays data until the specified address. This option affects the output of the-d,-r, and-s options.

-- Syms
-T indicates the entry to the symbol table of the file. Similar to the information provided by nm-s

-- Dynamic-syms
-T displays the file's dynamic symbol table entry, which is only meaningful to the dynamic target file, for example, some
Shared library. The information displayed is similar to the information displayed by nm-D | -- dynamic.

-- Version

Objdump -- version

-- All-headers
-X displays all available header information, including the symbol table and relocation entry. -X is equivalent
-A-f-h-r-t is specified at the same time.

Objdump-x inet. o

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.