From ac9b3c83fc626a3dcb68f1bd287e9c432d9f0b28 Mon Sep 17 00:00:00 2001 From: Yann Rouillard Date: Wed, 29 May 2013 23:23:27 +0200 Subject: [PATCH] rename Ver(def|need|sym)TableSection to GNUVer(Def|Need|Sym)TableSection --- elftools/elf/elffile.py | 28 ++++++++++++++-------------- elftools/elf/sections.py | 12 ++++++------ scripts/readelf.py | 16 ++++++++-------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/elftools/elf/elffile.py b/elftools/elf/elffile.py index 67b39af..0a7969d 100644 --- a/elftools/elf/elffile.py +++ b/elftools/elf/elffile.py @@ -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) diff --git a/elftools/elf/sections.py b/elftools/elf/sections.py index 8534144..1b947e2 100644 --- a/elftools/elf/sections.py +++ b/elftools/elf/sections.py @@ -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 diff --git a/scripts/readelf.py b/scripts/readelf.py index b437a5f..dc01566 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -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(): -- 2.30.2