def display_dynamic_tags(self):
""" Display the dynamic tags contained in the file
"""
- has_dynamic_section = False
for section in self.elffile.iter_sections():
if not isinstance(section, DynamicSection):
continue
- has_relocation_sections = True
self._emitline("\nDynamic section at offset %s contains %s entries:" % (
self._format_hex(section['sh_offset']),
section.num_tags()))
self._emitline(" Tag Type Name/Value")
- hexwidth = 8 if self.elffile.elfclass == 32 else 16
padding = 20 + (8 if self.elffile.elfclass == 32 else 0)
for tag in section.iter_tags():
if tag.entry.d_tag == 'DT_NEEDED':
parsed = 'Library rpath: [%s]' % tag.rpath
elif tag.entry.d_tag == 'DT_RUNPATH':
parsed = 'Library runpath: [%s]' % tag.runpath
+ elif tag.entry.d_tag == 'DT_SONAME':
+ parsed = 'Library soname: [%s]' % tag.soname
elif (tag.entry.d_tag.endswith('SZ') or
tag.entry.d_tag.endswith('ENT')):
parsed = '%i (bytes)' % tag['d_val']
- elif tag.entry.d_tag.endswith('NUM'):
+ elif (tag.entry.d_tag.endswith('NUM') or
+ tag.entry.d_tag.endswith('COUNT')):
parsed = '%i' % tag['d_val']
elif tag.entry.d_tag == 'DT_PLTREL':
s = describe_dyn_tag(tag.entry.d_val)
self._emitline(" %s %-*s %s" % (
self._format_hex(ENUM_D_TAG.get(tag.entry.d_tag, tag.entry.d_tag),
- fieldsize=hexwidth, lead0x=True),
+ fullhex=True, lead0x=True),
padding,
'(%s)' % (tag.entry.d_tag[3:],),
parsed))