From 15762b72b456998ac0f87ceec750a20e9872f325 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Wed, 5 Oct 2016 16:57:24 +0100 Subject: elf: Remove GetDynamicEntryCount and ReadBytes methods These are no longer used after the DynamicEntryList changes. --- Source/cmELF.cxx | 41 +---------------------------------------- Source/cmELF.h | 7 ------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 6f2885c..0655da9 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -132,7 +132,6 @@ public: // Forward to the per-class implementation. virtual unsigned int GetNumberOfSections() const = 0; - virtual unsigned int GetDynamicEntryCount() = 0; virtual unsigned long GetDynamicEntryPosition(int j) = 0; virtual cmELF::DynamicEntryList GetDynamicEntries() = 0; virtual std::vector EncodeDynamicEntries( @@ -140,13 +139,6 @@ public: virtual StringEntry const* GetDynamicSectionString(unsigned int tag) = 0; virtual void PrintInfo(std::ostream& os) const = 0; - bool ReadBytes(unsigned long pos, unsigned long size, char* buf) - { - this->Stream.seekg(pos); - this->Stream.read(buf, size); - return !this->Stream.fail(); - } - // Lookup the SONAME in the DYNAMIC section. StringEntry const* GetSOName() { @@ -249,8 +241,7 @@ public: return static_cast(this->ELFHeader.e_shnum); } - // Get the file position and size of a dynamic section entry. - unsigned int GetDynamicEntryCount() CM_OVERRIDE; + // Get the file position of a dynamic section entry. unsigned long GetDynamicEntryPosition(int j) CM_OVERRIDE; cmELF::DynamicEntryList GetDynamicEntries() CM_OVERRIDE; @@ -533,20 +524,6 @@ bool cmELFInternalImpl::LoadDynamicSection() } template -unsigned int cmELFInternalImpl::GetDynamicEntryCount() -{ - if (!this->LoadDynamicSection()) { - return 0; - } - for (unsigned int i = 0; i < this->DynamicSectionEntries.size(); ++i) { - if (this->DynamicSectionEntries[i].d_tag == DT_NULL) { - return i; - } - } - return static_cast(this->DynamicSectionEntries.size()); -} - -template unsigned long cmELFInternalImpl::GetDynamicEntryPosition(int j) { if (!this->LoadDynamicSection()) { @@ -793,14 +770,6 @@ unsigned int cmELF::GetNumberOfSections() const return 0; } -unsigned int cmELF::GetDynamicEntryCount() const -{ - if (this->Valid()) { - return this->Internal->GetDynamicEntryCount(); - } - return 0; -} - unsigned long cmELF::GetDynamicEntryPosition(int index) const { if (this->Valid()) { @@ -828,14 +797,6 @@ std::vector cmELF::EncodeDynamicEntries( return std::vector(); } -bool cmELF::ReadBytes(unsigned long pos, unsigned long size, char* buf) const -{ - if (this->Valid()) { - return this->Internal->ReadBytes(pos, size, buf); - } - return false; -} - bool cmELF::GetSOName(std::string& soname) { if (StringEntry const* se = this->GetSOName()) { diff --git a/Source/cmELF.h b/Source/cmELF.h index 9c56be7..763a240 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -72,10 +72,6 @@ public: /** Get the number of ELF sections present. */ unsigned int GetNumberOfSections() const; - /** Get the number of DYNAMIC section entries before the first - DT_NULL. Returns zero on error. */ - unsigned int GetDynamicEntryCount() const; - /** Get the position of a DYNAMIC section header entry. Returns zero on error. */ unsigned long GetDynamicEntryPosition(int index) const; @@ -89,9 +85,6 @@ public: std::vector EncodeDynamicEntries( const DynamicEntryList& entries) const; - /** Read bytes from the file. */ - bool ReadBytes(unsigned long pos, unsigned long size, char* buf) const; - /** Get the SONAME field if any. */ bool GetSOName(std::string& soname); StringEntry const* GetSOName(); -- cgit v0.12