PATCH: Display file offsets in objdump

Nick Clifton nickc@redhat.com
Thu Feb 21 09:19:00 GMT 2008


Hi Guys,

  I am going to apply the attached patch to add a new feature to
  objdump.  The idea, suggested by RMS, is to have the ability to
  see the file offsets of the data being displayed, so that overlaps
  can be detected, and to help anyone who wants to look at the file's
  contents in a hex editor.

  The new switch, -F, is off by default, but if used the output looks
  like this:
  
  08049710 <free@plt> (File Offset: 0x1710):
   8049710:       ff 25 1c 82 12 08       jmp    *0x812821c
   8049716:       68 60 02 00 00          push   $0x260
   804971b:       e9 20 fb ff ff          jmp    8049240 <_init+0x18> (File Offset: 0x1240)

  ie, whenever a symbol is displayed the file offset of the location
  pointed to by the symbol's value is displayed.  Also whenever a
  region of zeroes are skipped, the new code will tell the user how
  many zeroes were skipped and the file offset from where the
  disassembly resumes:

   80481e5:       00 00                   add    %al,(%eax)
   80481e7:       00 5a 00                add    %bl,0x0(%edx)
          ... (skipping 8 zeroes, resuming at file offset: 0x1f2)
   80481f2:       00 00                   add    %al,(%eax)
   80481f4:       33 00                   xor    (%eax),%eax

  Tested by building a whole host of different toolchains and running
  regression tests - there were none.

Cheers
  Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: objdump_F_patch.bz2
Type: application/x-bzip2
Size: 2778 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20080221/6d445fb2/attachment.bz2>


More information about the Binutils mailing list