summaryrefslogtreecommitdiffstats
path: root/Source/cmELF.h
diff options
context:
space:
mode:
authorJames Cowgill <james410@cowgill.org.uk>2016-10-05 15:43:16 (GMT)
committerJames Cowgill <james410@cowgill.org.uk>2016-10-06 15:52:36 (GMT)
commit72eb6a374ed12cfa0dee0ce1930a4dcd8473c700 (patch)
treec1b2e6f9b611a50de3217a0591d4a3e833f2f561 /Source/cmELF.h
parent66c4d0820ca86b0b119303859f3dae0f7c560969 (diff)
downloadCMake-72eb6a374ed12cfa0dee0ce1930a4dcd8473c700.zip
CMake-72eb6a374ed12cfa0dee0ce1930a4dcd8473c700.tar.gz
CMake-72eb6a374ed12cfa0dee0ce1930a4dcd8473c700.tar.bz2
elf: add DynamicEntryList methods and rpath tag constants
Diffstat (limited to 'Source/cmELF.h')
-rw-r--r--Source/cmELF.h18
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;