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
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)
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
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
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
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 (
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)
self._emitline()
- elif isinstance(section, GNUVerDefTableSection):
+ elif isinstance(section, GNUVerDefSection):
self._print_version_section_header(
section, 'Version definition', indent=2)
offset += verdef['vd_next']
- elif isinstance(section, GNUVerNeedTableSection):
+ elif isinstance(section, GNUVerNeedSection):
self._print_version_section_header(section, 'Version needs')
offset = 0
'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():
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):
elf = ELFFile(f)
versym_section = None
for section in elf.iter_sections():
- if isinstance(section, GNUVerSymTableSection):
+ if isinstance(section, GNUVerSymSection):
versym_section = section
break
elf = ELFFile(f)
verneed_section = None
for section in elf.iter_sections():
- if isinstance(section, GNUVerNeedTableSection):
+ if isinstance(section, GNUVerNeedSection):
verneed_section = section
break
elf = ELFFile(f)
verneed_section = None
for section in elf.iter_sections():
- if isinstance(section, GNUVerDefTableSection):
+ if isinstance(section, GNUVerDefSection):
verdef_section = section
break