summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Cowgill <james410@cowgill.org.uk>2016-10-05 15:57:24 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-07 12:30:00 (GMT)
commit15762b72b456998ac0f87ceec750a20e9872f325 (patch)
tree20c96ca40399ace1e09f661186c00f7f94f51be1
parentcd4f573ae9f4ded1cb386698f90c7ccf1504f094 (diff)
downloadCMake-15762b72b456998ac0f87ceec750a20e9872f325.zip
CMake-15762b72b456998ac0f87ceec750a20e9872f325.tar.gz
CMake-15762b72b456998ac0f87ceec750a20e9872f325.tar.bz2
elf: Remove GetDynamicEntryCount and ReadBytes methods
These are no longer used after the DynamicEntryList changes.
-rw-r--r--Source/cmELF.cxx41
-rw-r--r--Source/cmELF.h7
2 files changed, 1 insertions, 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<char> 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<unsigned int>(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<Types>::LoadDynamicSection()
}
template <class Types>
-unsigned int cmELFInternalImpl<Types>::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<unsigned int>(this->DynamicSectionEntries.size());
-}
-
-template <class Types>
unsigned long cmELFInternalImpl<Types>::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<char> cmELF::EncodeDynamicEntries(
return std::vector<char>();
}
-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<char> 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();