Remove Table from GNU version sections class name
authorYann Rouillard <yann@pleiades.fr.eu.org>
Fri, 31 May 2013 19:01:25 +0000 (21:01 +0200)
committerYann Rouillard <yann@pleiades.fr.eu.org>
Fri, 31 May 2013 19:01:25 +0000 (21:01 +0200)
elftools/elf/elffile.py
elftools/elf/gnuversions.py
scripts/readelf.py
test/test_gnuversions.py

index 979ed2d0a245d7ae606dd76a72b47526901637ce..b15b1ece67be103a5de21a78cc016e08465830a4 100644 (file)
@@ -17,8 +17,8 @@ from .sections import (
 from .dynamic import DynamicSection, DynamicSegment
 from .relocation import RelocationSection, RelocationHandler
 from .gnuversions import (
-        GNUVerNeedTableSection, GNUVerDefTableSection,
-        GNUVerSymTableSection)
+        GNUVerNeedSection, GNUVerDefSection,
+        GNUVerSymSection)
 from .segments import Segment, InterpSegment
 from .enums import ENUM_RELOC_TYPE_i386, ENUM_RELOC_TYPE_x64
 from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
@@ -286,31 +286,31 @@ class ELFFile(object):
             symboltable=strtab_section)
 
     def _make_gnu_verneed_section(self, section_header, name):
-        """ Create a GNUVerNeedTableSection
+        """ Create a GNUVerNeedSection
         """
         linked_strtab_index = section_header['sh_link']
         strtab_section = self.get_section(linked_strtab_index)
-        return GNUVerNeedTableSection(
+        return GNUVerNeedSection(
             section_header, name, self.stream,
             elffile=self,
             stringtable=strtab_section)
 
     def _make_gnu_verdef_section(self, section_header, name):
-        """ Create a GNUVerDefTableSection
+        """ Create a GNUVerDefSection
         """
         linked_strtab_index = section_header['sh_link']
         strtab_section = self.get_section(linked_strtab_index)
-        return GNUVerDefTableSection(
+        return GNUVerDefSection(
             section_header, name, self.stream,
             elffile=self,
             stringtable=strtab_section)
 
     def _make_gnu_versym_section(self, section_header, name):
-        """ Create a GNUVerSymTableSection
+        """ Create a GNUVerSymSection
         """
         linked_strtab_index = section_header['sh_link']
         strtab_section = self.get_section(linked_strtab_index)
-        return GNUVerSymTableSection(
+        return GNUVerSymSection(
             section_header, name, self.stream,
             elffile=self,
             symboltable=strtab_section)
index 79110d7c8963dcfd7244efb2e4bd472d3093c69a..5965659388dde567fc0327f31bf04e53bc214ab7 100644 (file)
@@ -51,12 +51,12 @@ class VersionAuxiliary(object):
         return self.entry[name]
 
 
-class GNUVerNeedTableSection(Section):
+class GNUVerNeedSection(Section):
     """ ELF SUNW or GNU Version Needed table section.
         Has an associated StringTableSection that's passed in the constructor.
     """
     def __init__(self, header, name, stream, elffile, stringtable):
-        super(GNUVerNeedTableSection, self).__init__(header, name, stream)
+        super(GNUVerNeedSection, self).__init__(header, name, stream)
         self.elffile = elffile
         self.elfstructs = self.elffile.structs
         self.stringtable = stringtable
@@ -141,12 +141,12 @@ class GNUVerNeedTableSection(Section):
             entry_offset += entry['vn_next']
 
 
-class GNUVerDefTableSection(Section):
+class GNUVerDefSection(Section):
     """ ELF SUNW or GNU Version Definition table section.
         Has an associated StringTableSection that's passed in the constructor.
     """
     def __init__(self, header, name, stream, elffile, stringtable):
-        super(GNUVerDefTableSection, self).__init__(header, name, stream)
+        super(GNUVerDefSection, self).__init__(header, name, stream)
         self.elffile = elffile
         self.elfstructs = self.elffile.structs
         self.stringtable = stringtable
@@ -214,12 +214,12 @@ class GNUVerDefTableSection(Section):
             entry_offset += entry['vd_next']
 
 
-class GNUVerSymTableSection(Section):
+class GNUVerSymSection(Section):
     """ ELF SUNW or GNU Versym table section.
         Has an associated SymbolTableSection that's passed in the constructor.
     """
     def __init__(self, header, name, stream, elffile, symboltable):
-        super(GNUVerSymTableSection, self).__init__(header, name, stream)
+        super(GNUVerSymSection, self).__init__(header, name, stream)
         self.elffile = elffile
         self.elfstructs = self.elffile.structs
         self.symboltable = symboltable
index e516b660871ddb1af40e8051c912daa0d70a6610..06a6edd0c62744bd5e1245164eb1da717da32477 100755 (executable)
@@ -26,8 +26,8 @@ from elftools.elf.enums import ENUM_D_TAG
 from elftools.elf.segments import InterpSegment
 from elftools.elf.sections import SymbolTableSection
 from elftools.elf.gnuversions import (
-    GNUVerSymTableSection, GNUVerDefTableSection,
-    GNUVerNeedTableSection,
+    GNUVerSymSection, GNUVerDefSection,
+    GNUVerNeedSection,
     )
 from elftools.elf.relocation import RelocationSection
 from elftools.elf.descriptions import (
@@ -424,7 +424,7 @@ class ReadElf(object):
             return
 
         for section in self.elffile.iter_sections():
-            if isinstance(section, GNUVerSymTableSection):
+            if isinstance(section, GNUVerSymSection):
                 self._print_version_section_header(
                     section, 'Version symbols', lead0x=False)
 
@@ -455,7 +455,7 @@ class ReadElf(object):
 
                     self._emitline()
 
-            elif isinstance(section, GNUVerDefTableSection):
+            elif isinstance(section, GNUVerDefSection):
                 self._print_version_section_header(
                     section, 'Version definition', indent=2)
 
@@ -488,7 +488,7 @@ class ReadElf(object):
 
                     offset += verdef['vd_next']
 
-            elif isinstance(section, GNUVerNeedTableSection):
+            elif isinstance(section, GNUVerNeedSection):
                 self._print_version_section_header(section, 'Version needs')
 
                 offset = 0
@@ -697,11 +697,11 @@ class ReadElf(object):
                              'verneed': None, 'type': None}
 
         for section in self.elffile.iter_sections():
-            if isinstance(section, GNUVerSymTableSection):
+            if isinstance(section, GNUVerSymSection):
                 self._versioninfo['versym'] = section
-            elif isinstance(section, GNUVerDefTableSection):
+            elif isinstance(section, GNUVerDefSection):
                 self._versioninfo['verdef'] = section
-            elif isinstance(section, GNUVerNeedTableSection):
+            elif isinstance(section, GNUVerNeedSection):
                 self._versioninfo['verneed'] = section
             elif isinstance(section, DynamicSection):
                 for tag in section.iter_tags():
index a989aebc66463584e1bbb5035f678737484d464f..8c1786a1faecdf769529108c75cc8c98ed6aba79 100644 (file)
@@ -15,8 +15,8 @@ setup_syspath()
 from elftools.elf.elffile import ELFFile
 from elftools.elf.constants import VER_FLAGS
 from elftools.elf.gnuversions import (
-        GNUVerNeedTableSection, GNUVerDefTableSection,
-        GNUVerSymTableSection)
+        GNUVerNeedSection, GNUVerDefSection,
+        GNUVerSymSection)
 
 
 class TestSymbolVersioning(unittest.TestCase):
@@ -57,7 +57,7 @@ class TestSymbolVersioning(unittest.TestCase):
             elf = ELFFile(f)
             versym_section = None
             for section in elf.iter_sections():
-                if isinstance(section, GNUVerSymTableSection):
+                if isinstance(section, GNUVerSymSection):
                     versym_section = section
                     break
 
@@ -87,7 +87,7 @@ class TestSymbolVersioning(unittest.TestCase):
             elf = ELFFile(f)
             verneed_section = None
             for section in elf.iter_sections():
-                if isinstance(section, GNUVerNeedTableSection):
+                if isinstance(section, GNUVerNeedSection):
                     verneed_section = section
                     break
 
@@ -137,7 +137,7 @@ class TestSymbolVersioning(unittest.TestCase):
             elf = ELFFile(f)
             verneed_section = None
             for section in elf.iter_sections():
-                if isinstance(section, GNUVerDefTableSection):
+                if isinstance(section, GNUVerDefSection):
                     verdef_section = section
                     break