Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv12836
Modified Files:
elfdump.py
Log Message:
cleanup
Index: elfdump.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/elfdump.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- elfdump.py 15 Apr 2003 00:03:49 -0000 1.7
+++ elfdump.py 15 Apr 2003 00:08:16 -0000 1.8
@@ -88,28 +88,27 @@
print '== ==== ====== ======== ======== ====== ====== === ====='
for i in range(e_phnum):
- phentry = f.read(e_phentsize)
- p_type, p_offset, p_vaddr, p_paddr, p_filesz, p_memsz, \
- p_flags, p_align = struct.unpack(bytesex + ' 8L', phentry[:32])
print '%2x' % i,
- enum_shortly(4, p_type, {PT.NULL: 'null',
- PT.LOAD: 'load',
- PT.DYNAMIC: 'dyna',
- PT.INTERP: 'inte',
- PT.NOTE: 'note',
- PT.SHLIB: 'shli',
- PT.PHDR: 'phdr',
- PT.TLS: 'tls '})
- print '%6x' % p_offset,
- print '%8x' % p_vaddr,
- print '%8x' % p_paddr,
+ enum_shortly(4, take('t'), {PT.NULL: 'null',
+ PT.LOAD: 'load',
+ PT.DYNAMIC: 'dyna',
+ PT.INTERP: 'inte',
+ PT.NOTE: 'note',
+ PT.SHLIB: 'shli',
+ PT.PHDR: 'phdr',
+ PT.TLS: 'tls '})
+ print '%6x' % take('t'),
+ print '%8x' % take('t'),
+ print '%8x' % take('t'),
+ p_filesz, p_memsz = take('tt')
if p_filesz > p_memsz: c = '>'
elif p_filesz < p_memsz: c = '<'
else: c = ' '
print '%6x%c%6x' % (p_filesz, c, p_memsz),
- flags_shortly('rwx', p_flags)
- print '%5x' % p_align,
+ flags_shortly('rwx', take('t'))
+ print '%5x' % take('t'),
print
+ phentry = f.read(32 - e_phentsize) # skip unprocessed bytes
print
else:
print 'No program header table'
|