diff options
Diffstat (limited to 'Source/cmELF.h')
-rw-r--r-- | Source/cmELF.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmELF.h b/Source/cmELF.h index 7e7c1d6..3fc59b4 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,6 +63,9 @@ 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; @@ -75,6 +80,15 @@ public: zero on error. */ unsigned long GetDynamicEntryPosition(int index) 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; + /** Read bytes from the file. */ bool ReadBytes(unsigned long pos, unsigned long size, char* buf) const; @@ -91,6 +105,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; + private: friend class cmELFInternal; bool Valid() const; |