From: Yann Rouillard Date: Sun, 19 May 2013 16:35:32 +0000 (+0200) Subject: minor modification in the section search loop of elfdump.py X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9813d345b3262a4ec627691ee536386e16bef3dd;p=pyelftools.git minor modification in the section search loop of elfdump.py --- diff --git a/scripts/elfdump.py b/scripts/elfdump.py index 5e7078f..a52c0b4 100755 --- a/scripts/elfdump.py +++ b/scripts/elfdump.py @@ -64,17 +64,19 @@ class Elfdump(object): def display_syminfo_table(self): """ Display the SUNW syminfo tables contained in the file """ - # The symbol table section pointed to in sh_link - dyntable = self.elffile.get_section_by_name('.dynamic') - for section in self.elffile.iter_sections(): - if not isinstance(section, SUNWSyminfoTableSection): - continue + if isinstance(section, SUNWSyminfoTableSection): + syminfo_section = section + break + + if syminfo_section: + # We need to dyntable to do get the soname names + dyntable = self.elffile.get_section_by_name('.dynamic') if section['sh_entsize'] == 0: self._emitline("\nSymbol table '%s' has a sh_entsize of zero!" % ( bytes2str(section.name))) - continue + return # The symbol table section pointed to in sh_link symtable = self.elffile.get_section(section['sh_link'])