summaryrefslogtreecommitdiff
path: root/include/llvm/Object/ObjectFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Object/ObjectFile.h')
-rw-r--r--include/llvm/Object/ObjectFile.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h
index c73a568c1c..ba1bb6945b 100644
--- a/include/llvm/Object/ObjectFile.h
+++ b/include/llvm/Object/ObjectFile.h
@@ -28,12 +28,8 @@ namespace object {
class ObjectFile;
union DataRefImpl {
- struct {
- // ELF needs this for relocations. This entire union should probably be a
- // char[max(8, sizeof(uintptr_t))] and require the impl to cast.
- uint16_t a, b;
- uint32_t c;
- } w;
+ // This entire union should probably be a
+ // char[max(8, sizeof(uintptr_t))] and require the impl to cast.
struct {
uint32_t a, b;
} d;
@@ -133,6 +129,8 @@ typedef content_iterator<RelocationRef> relocation_iterator;
/// SectionRef - This is a value type class that represents a single section in
/// the list of sections in the object file.
+class SectionRef;
+typedef content_iterator<SectionRef> section_iterator;
class SectionRef {
friend class SymbolRef;
DataRefImpl SectionPimpl;
@@ -169,10 +167,10 @@ public:
relocation_iterator begin_relocations() const;
relocation_iterator end_relocations() const;
+ section_iterator getRelocatedSection() const;
DataRefImpl getRawDataRefImpl() const;
};
-typedef content_iterator<SectionRef> section_iterator;
/// SymbolRef - This is a value type class that represents a single symbol in
/// the list of symbols in the object file.
@@ -326,7 +324,7 @@ protected:
bool &Result) const = 0;
virtual relocation_iterator getSectionRelBegin(DataRefImpl Sec) const = 0;
virtual relocation_iterator getSectionRelEnd(DataRefImpl Sec) const = 0;
-
+ virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
// Same as above for RelocationRef.
friend class RelocationRef;
@@ -538,6 +536,10 @@ inline relocation_iterator SectionRef::end_relocations() const {
return OwningObject->getSectionRelEnd(SectionPimpl);
}
+inline section_iterator SectionRef::getRelocatedSection() const {
+ return OwningObject->getRelocatedSection(SectionPimpl);
+}
+
inline DataRefImpl SectionRef::getRawDataRefImpl() const {
return SectionPimpl;
}