How to use objdump and the meaning of each column of the symbol table

Source: Internet
Author: User

First, the use of objdump

Man Handbook 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, similar to AR TV
Objdump-a Libpcap.a
Comparison of display results with Ar-tv LIBPCAP.A
Obviously this option doesn't mean anything.
--adjust-vma=offset
When dumping information, first add offset to all
The section addresses. This is useful if the sec-
tion addresses don't correspond to the symbol
Table, which can happen when putting sections at
Particular addresses when using a format which can
Not represent section addresses, such as a.out.
-B Bfdname
--target=bfdname
Specifies the destination code format. This is not necessary, Objdump can automatically identify many formats,
For example: Objdump-b oasys-m vax-h FU.O
Displays the header summary information of the FU.O, stating clearly that the file is used under the VAX system Oasys
The target file generated by the compiler. Objdump-i will give you what you can specify here.
Destination Code Format list
--demangle
-C decodes the underlying symbol name into a user-level name, except to remove all openings
Underline, it also makes the C + + function name appear in an understandable way.
--debugging
Displays debugging information. Attempt to parse the debug information saved in the file and in C language
syntax is displayed. Only certain types of debugging information are supported.
--disassemble
-D disassembly of sections that should also have instruction machine code
--disassemble-all
-D is similar to-D but assembles all sections
--prefix-addresses
When disassembling, displays the full address of each line. This is a relatively old disassembly format.
The display is not ideal, but some of the displays may be used and can be compared.
--disassemble-zeroes
The general disassembly output will omit chunks of 0, which makes these 0 blocks also disassembled.
-eb
-el
--endian={big|little}
This option will affect the disassembly instructions.
Little-endian is the high address that we used to say when we played a compilation in DOS.
x86 are the same.

--file-headers
-F Displays the overall header summary information for each file in the objfile.

--section-headers
--headers
-H Displays header summary information for each section of the destination file.

--help a short help message.

--info
-I displays a list of schema and destination formats available for the-B or-M options.

--section=name
-j Name displays only the information for the specified section

--line-numbers
-l labels the corresponding target code with the file name and line number, only with-D,-D, or-R
The difference between using-LD and using-D is not very large, useful when debugging at the source level, requiring
Debug compilation options such as-G are used at compile time.

--architecture=machine
-M machine
Specifies the schema to use when disassembling the target file when the disassembly file itself is not described
This option is useful when you have schema information (such as S-records). You can use the-i option
Lists the schemas that can be specified here

--reloc
-r Displays the file's relocation entry. If used with-D or-D, reposition the part to reverse-sink
The PostScript format is displayed.

--dynamic-reloc
-r Displays the file's dynamic relocation entry, which is only meaningful for dynamic target files, such as some
Shared libraries.

--full-contents
-S displays the full contents of the specified section.

Objdump--section=.text-s INET.O | More

--source
-S to disassemble the source code as much as possible, especially when you specify the debug parameter of-G when compiling,
The effect is more obvious. The-d parameter is implied.

--show-raw-insn
During disassembly, the machine code corresponding to each assembly instruction is displayed, unless the specified
--prefix-addresses, this will be the default option.

--no-show-raw-insn
Disassembly, the machine code for assembly instructions is not displayed, this is the specified--prefix-addresses
option is the default setting.

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

--start-address=address
Displays data starting at the specified address, which affects the output of the-D,-R, and-s options.

--stop-address=address
Displays data until the specified address, which affects the output of the-D,-R, and-s options.

--syms
-T displays the symbol table entry for 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 for dynamic target files, such as some
Shared libraries. It displays information similar to the information displayed by the nm-d|--dynamic.

--version Version Information

Objdump--version

--all-headers
-X displays all available header information, including the symbol table, reposition entry. -X is equivalent to
-a-f-h-r-T is also specified.

Objdump-x INET.O

How to use objdump and the meaning of each column of the symbol table

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.