Forráskód Böngészése

elf: Remove GetDynamicEntryCount and ReadBytes methods

These are no longer used after the DynamicEntryList changes.
James Cowgill 9 éve
szülő
commit
15762b72b4
2 módosított fájl, 1 hozzáadás és 47 törlés
  1. 1 40
      Source/cmELF.cxx
  2. 0 7
      Source/cmELF.h

+ 1 - 40
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;
@@ -532,20 +523,6 @@ bool cmELFInternalImpl<Types>::LoadDynamicSection()
   return true;
 }
 
-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)
 {
@@ -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()) {

+ 0 - 7
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();