From 9813d345b3262a4ec627691ee536386e16bef3dd Mon Sep 17 00:00:00 2001 From: Yann Rouillard Date: Sun, 19 May 2013 18:35:32 +0200 Subject: [PATCH] minor modification in the section search loop of elfdump.py --- scripts/elfdump.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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']) -- 2.30.2