diff options
Diffstat (limited to 'Source/cmELF.h')
-rw-r--r-- | Source/cmELF.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmELF.h b/Source/cmELF.h index 7e7c1d6..763a240 100644 --- a/Source/cmELF.h +++ b/Source/cmELF.h @@ -7,6 +7,8 @@ #include <iosfwd> #include <string> +#include <utility> +#include <vector> #if !defined(CMAKE_USE_ELF_PARSER) #error "This file may be included only if CMAKE_USE_ELF_PARSER is enabled." @@ -61,22 +63,27 @@ public: int IndexInSection; }; + /** Represent entire dynamic section header */ + typedef std::vector<std::pair<long, unsigned long> > DynamicEntryList; + /** Get the type of the file opened. */ FileType GetFileType() const; /** 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; - /** Read bytes from the file. */ - bool ReadBytes(unsigned long pos, unsigned long size, char* buf) const; + /** Get a copy of all the DYNAMIC section header entries. + Returns an empty vector on error */ + DynamicEntryList GetDynamicEntries() const; + + /** Encodes a DYNAMIC section header entry list into a char vector according + to the type of ELF file this is */ + std::vector<char> EncodeDynamicEntries( + const DynamicEntryList& entries) const; /** Get the SONAME field if any. */ bool GetSOName(std::string& soname); @@ -91,6 +98,10 @@ public: /** Print human-readable information about the ELF file. */ void PrintInfo(std::ostream& os) const; + /** Interesting dynamic tags. + If the tag is 0, it does not exist in the host ELF implementation */ + static const long TagRPath, TagRunPath, TagMipsRldMapRel; + private: friend class cmELFInternal; bool Valid() const; |