0

I am learning about objdump and know basic about it.

Objdump displays information about one or more object files.

Some people told me that we can using objdump to debug memory corruption, avoid global variable buffer overflow, optimize code ... but I don't know how to use it to do that?

Could you give me some examples for it?

T1412
  • 705
  • 1
  • 5
  • 12
  • 2
    You can find all sorts of information about object code or executables from `objdump`, but it isn't essential to programming. – Jonathan Leffler Oct 16 '19 at 04:52
  • Wouldn't `valgrind` be a better choice? – ikegami Oct 16 '19 at 05:27
  • @JonathanLeffler so If I only care about programming, I don't need care about objdump? – T1412 Oct 16 '19 at 05:35
  • AFAIK objdump is not the right tool for the things you mention. Kind of like a fork is not the right tool for cutting down a tree. – Jabberwocky Oct 16 '19 at 05:49
  • 1
    Knowing about `objdump` can't be harmful, but I wouldn't regard it as crucial either. I've been programming a while — longer than `objdump` has been available — and I've not needed to use it. There might have been a few occasions where it would have been very useful, but not all that many. Other people may have more use for it; they wouldn't necessarily be wrong. For debugging memory corruption, I'd probably use [`valgrind`](http://valgrind.org/) first. I avoid global variable buffer overflow by not having many global variables and being careful. I let the compiler do code optimization. – Jonathan Leffler Oct 16 '19 at 07:11

0 Answers0