From b0d55d87b9fca72d47c23e7174cf6307fce2b823 Mon Sep 17 00:00:00 2001 From: Yann Rouillard Date: Mon, 29 Apr 2013 02:07:06 +0200 Subject: [PATCH] start enumerating syminfo entries at index 1 --- scripts/elfdump.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/elfdump.py b/scripts/elfdump.py index aef365a..853746d 100755 --- a/scripts/elfdump.py +++ b/scripts/elfdump.py @@ -82,10 +82,10 @@ class Elfdump(object): self._emitline("\nSyminfo Section: %s" % bytes2str(section.name)) self._emitline(' index flags bound to symbol') - for nsym, syminfo in enumerate(section.iter_symbols()): + for nsym, syminfo in enumerate(section.iter_symbols(), start=1): # elfdump doesn't display anything for this kind of symbols - symbol = symtable.get_symbol(nsym + 1) + symbol = symtable.get_symbol(nsym) if (symbol['st_info']['type'] == 'STT_NOTYPE' and symbol['st_shndx'] == 'SHN_UNDEF'): continue @@ -105,7 +105,7 @@ class Elfdump(object): # syminfo names are truncated to 25 chars, similarly to readelf self._emitline('%10s %-5s %10s %-24s %s' % ( - '[%d]' % (int(nsym) + 1), + '[%d]' % (int(nsym)), describe_syminfo_flags(syminfo['si_flags']), index, boundto, -- 2.30.2