diff options
author | Owen Anderson <resistor@mac.com> | 2011-10-25 20:35:53 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-10-25 20:35:53 +0000 |
commit | 0685e94895f26f96aa1032696e3150dd00aad1f3 (patch) | |
tree | f6d9ff1ff353c7f88f0b43b0461338e50d19fcc6 /include/llvm/Object | |
parent | f62333df5e31843178678a6aad6e0d9bbe16c283 (diff) | |
download | external_llvm-0685e94895f26f96aa1032696e3150dd00aad1f3.zip external_llvm-0685e94895f26f96aa1032696e3150dd00aad1f3.tar.gz external_llvm-0685e94895f26f96aa1032696e3150dd00aad1f3.tar.bz2 |
Add support for the notion of "hidden" relocations. On MachO, these are relocation entries that are used as additional information for other, real relocations, rather than being relocations themselves.
I'm not familiar enough with ELF or COFF to know if they should have any relocations marked hidden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142961 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object')
-rw-r--r-- | include/llvm/Object/MachO.h | 1 | ||||
-rw-r--r-- | include/llvm/Object/ObjectFile.h | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 1ae9372..dcf116e 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -88,6 +88,7 @@ protected: int64_t &Res) const; virtual error_code getRelocationValueString(DataRefImpl Rel, SmallVectorImpl<char> &Result) const; + virtual error_code getRelocationHidden(DataRefImpl Rel, bool &Result) const; private: MachOObject *MachOObj; diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index 331ed7c..0c7a518 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -101,6 +101,11 @@ public: error_code getSymbol(SymbolRef &Result) const; error_code getType(uint32_t &Result) const; + /// @brief Indicates whether this relocation should hidden when listing + /// relocations, usually because it is the trailing part of a multipart + /// relocation that will be printed as part of the leading relocation. + error_code getHidden(bool &Result) const; + /// @brief Get a string that represents the type of this relocation. /// /// This is for display purposes only. @@ -286,6 +291,10 @@ protected: int64_t &Res) const = 0; virtual error_code getRelocationValueString(DataRefImpl Rel, SmallVectorImpl<char> &Result) const = 0; + virtual error_code getRelocationHidden(DataRefImpl Rel, bool &Result) const { + Result = false; + return object_error::success; + } public: @@ -483,6 +492,10 @@ inline error_code RelocationRef::getValueString(SmallVectorImpl<char> &Result) return OwningObject->getRelocationValueString(RelocationPimpl, Result); } +inline error_code RelocationRef::getHidden(bool &Result) const { + return OwningObject->getRelocationHidden(RelocationPimpl, Result); +} + } // end namespace object } // end namespace llvm |