rename Ver(def|need|sym)TableSection to GNUVer(Def|Need|Sym)TableSection
authorYann Rouillard <yann@pleiades.fr.eu.org>
Wed, 29 May 2013 21:23:27 +0000 (23:23 +0200)
committerYann Rouillard <yann@pleiades.fr.eu.org>
Wed, 29 May 2013 21:23:27 +0000 (23:23 +0200)
elftools/elf/elffile.py
elftools/elf/sections.py
scripts/readelf.py

index 67b39afb4cc51f71b40b5a5f5e6d4e4d9fa8e1e5..0a7969dac599f878a53b07b33a310d422272873a 100644 (file)
@@ -13,8 +13,8 @@ from ..construct import ConstructError
 from .structs import ELFStructs
 from .sections import (
         Section, StringTableSection, SymbolTableSection,
-        SUNWSyminfoTableSection, VerneedTableSection, 
-        VerdefTableSection, VersymTableSection,
+        SUNWSyminfoTableSection, GNUVerNeedTableSection, 
+        GNUVerDefTableSection, GNUVerSymTableSection,
         NullSection)
 from .dynamic import DynamicSection, DynamicSegment
 from .relocation import RelocationSection, RelocationHandler
@@ -251,11 +251,11 @@ class ELFFile(object):
         elif sectype == 'SHT_SUNW_syminfo':
             return self._make_sunwsyminfo_table_section(section_header, name)
         elif sectype == 'SHT_GNU_verneed':
-            return self._make_verneed_table_section(section_header, name)
+            return self._make_gnu_verneed_section(section_header, name)
         elif sectype == 'SHT_GNU_verdef':
-            return self._make_verdef_table_section(section_header, name)
+            return self._make_gnu_verdef_section(section_header, name)
         elif sectype == 'SHT_GNU_versym':
-            return self._make_versym_table_section(section_header, name)
+            return self._make_gnu_versym_section(section_header, name)
         elif sectype in ('SHT_REL', 'SHT_RELA'):
             return RelocationSection(
                 section_header, name, self.stream, self)
@@ -284,32 +284,32 @@ class ELFFile(object):
             elffile=self,
             symboltable=strtab_section)
 
-    def _make_verneed_table_section(self, section_header, name):
-        """ Create a VerneedTableSection
+    def _make_gnu_verneed_section(self, section_header, name):
+        """ Create a GNUVerNeedTableSection
         """
         linked_strtab_index = section_header['sh_link']
         strtab_section = self.get_section(linked_strtab_index)
-        return VerneedTableSection(
+        return GNUVerNeedTableSection(
             section_header, name, self.stream,
             elffile=self,
             stringtable=strtab_section)
 
-    def _make_verdef_table_section(self, section_header, name):
-        """ Create a VerdefTableSection
+    def _make_gnu_verdef_section(self, section_header, name):
+        """ Create a GNUVerDefTableSection
         """
         linked_strtab_index = section_header['sh_link']
         strtab_section = self.get_section(linked_strtab_index)
-        return VerdefTableSection(
+        return GNUVerDefTableSection(
             section_header, name, self.stream,
             elffile=self,
             stringtable=strtab_section)
 
-    def _make_versym_table_section(self, section_header, name):
-        """ Create a VersymTableSection
+    def _make_gnu_versym_section(self, section_header, name):
+        """ Create a GNUVerSymTableSection
         """
         linked_strtab_index = section_header['sh_link']
         strtab_section = self.get_section(linked_strtab_index)
-        return VersymTableSection(
+        return GNUVerSymTableSection(
             section_header, name, self.stream,
             elffile=self,
             symboltable=strtab_section)
index 853414469a27cd363e7a4b2181949d1745bc006e..1b947e214816daa78995fd32f23c8bc490ce5377 100644 (file)
@@ -199,12 +199,12 @@ class VersionAuxiliary(object):
         """
         return self.entry[name]
 
-class VerneedTableSection(Section):
+class GNUVerNeedTableSection(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(VerneedTableSection, self).__init__(header, name, stream)
+        super(GNUVerNeedTableSection, self).__init__(header, name, stream)
         self.elffile = elffile
         self.elfstructs = self.elffile.structs
         self.stringtable = stringtable
@@ -290,12 +290,12 @@ class VerneedTableSection(Section):
             entry_offset += entry['vn_next'] 
 
 
-class VerdefTableSection(Section):
+class GNUVerDefTableSection(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(VerdefTableSection, self).__init__(header, name, stream)
+        super(GNUVerDefTableSection, self).__init__(header, name, stream)
         self.elffile = elffile
         self.elfstructs = self.elffile.structs
         self.stringtable = stringtable
@@ -364,12 +364,12 @@ class VerdefTableSection(Section):
             entry_offset += entry['vd_next'] 
 
 
-class VersymTableSection(Section):
+class GNUVerSymTableSection(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(VersymTableSection, self).__init__(header, name, stream)
+        super(GNUVerSymTableSection, self).__init__(header, name, stream)
         self.elffile = elffile
         self.elfstructs = self.elffile.structs
         self.symboltable = symboltable
index b437a5f5154742fd7ca9dc155a41651e45d9ff73..dc0156675c31bd6a417a7131a2600d05df97f707 100755 (executable)
@@ -25,8 +25,8 @@ from elftools.elf.dynamic import DynamicSection, DynamicSegment
 from elftools.elf.enums import ENUM_D_TAG
 from elftools.elf.segments import InterpSegment
 from elftools.elf.sections import (
-    SymbolTableSection, VersymTableSection,
-    VerdefTableSection, VerneedTableSection,
+    SymbolTableSection, GNUVerSymTableSection,
+    GNUVerDefTableSection, GNUVerNeedTableSection,
     )
 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, VersymTableSection):
+            if isinstance(section, GNUVerSymTableSection):
 
                 self._print_version_section_header(
                     section, 'Version symbols', lead0x=False)
@@ -456,7 +456,7 @@ class ReadElf(object):
 
                     self._emitline()
 
-            elif isinstance(section, VerdefTableSection):
+            elif isinstance(section, GNUVerDefTableSection):
 
                 self._print_version_section_header(
                     section, 'Version definition', indent=2)
@@ -490,7 +490,7 @@ class ReadElf(object):
 
                     offset += verdef['vd_next']
 
-            elif isinstance(section, VerneedTableSection):
+            elif isinstance(section, GNUVerNeedTableSection):
 
                 self._print_version_section_header(section, 'Version needs')
 
@@ -696,11 +696,11 @@ class ReadElf(object):
                               'verneed': None, 'type': None }
 
         for section in self.elffile.iter_sections():
-            if isinstance(section, VersymTableSection):
+            if isinstance(section, GNUVerSymTableSection):
                 self._versioninfo['versym'] = section
-            elif isinstance(section, VerdefTableSection):
+            elif isinstance(section, GNUVerDefTableSection):
                 self._versioninfo['verdef'] = section
-            elif isinstance(section, VerneedTableSection):
+            elif isinstance(section, GNUVerNeedTableSection):
                 self._versioninfo['verneed'] = section
             elif isinstance(section, DynamicSection):
                 for tag in section.iter_tags():