minor modification in the section search loop of elfdump.py
authorYann Rouillard <yann@pleiades.fr.eu.org>
Sun, 19 May 2013 16:35:32 +0000 (18:35 +0200)
committerYann Rouillard <yann@pleiades.fr.eu.org>
Sun, 19 May 2013 16:35:32 +0000 (18:35 +0200)
scripts/elfdump.py

index 5e7078fc22d694a918bc9af757de88a2bfb4ca90..a52c0b497cb1be7d07ff806b7d9a796a1074a7be 100755 (executable)
@@ -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'])