This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Display file offsets in objdump


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

Attachment: objdump_F_patch.bz2
Description: BZip2 compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]