From: Yann Rouillard Date: Mon, 29 Apr 2013 00:07:06 +0000 (+0200) Subject: start enumerating syminfo entries at index 1 X-Git-Tag: v0.22~75 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b0d55d87b9fca72d47c23e7174cf6307fce2b823;p=pyelftools.git start enumerating syminfo entries at index 1 --- 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,