Differences between objdump and readelf

Source: Internet
Author: User

The functions of objdump and readelf are similar. You can read the corresponding information from the binary file and display the differences between them. The differences are described in readelf. C:

/* The difference between readelf and objdump:

 

Both programs are capable of displaying the contents of ELF format files,

So why does the binutils project have two file dumpers?

 

The reason is that objdump sees an elf file through a BFD filter of

World; If BFD has a bug where, say, it disagrees about a machine constant

In e_flags, then the odds are good that it will remain internally

Consistent. The linker sees it the BFD way, objdump sees it the BFD way,

Gas sees it the BFD way. There was need for a tool to go find out what

The file actually says.

 

This is why the readelf program does not link against the BFD library-it

Exists as an independent program to help verify the correct working of BFD.

 

There is also the case that readelf can provide more information about

ELF File than is provided by objdump. In particle it can display dwarf

Debugging information which (at the moment) objdump cannot .*/

The first difference is that objdump uses the BFD library for file reading, while readelf does not. In addition, it writes a set of code and does not strictly judge certain conditions. For example, if the CPU type of the processing method is not specified, the BFD library will refuse to execute it, And the readelf can still display its content.

The second difference is that readelf can display debugging information, while objdump does not. However, in fact, the BFD Library supports dwarf processing. By simply processing objdump, debugging information can also be displayed, just as NM does.

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.