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.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h
index 02d62e8e48798..036c99cb6baff 100644
--- a/include/llvm/Object/ObjectFile.h
+++ b/include/llvm/Object/ObjectFile.h
@@ -104,13 +104,25 @@ public:
uint64_t getAlignment() const;
bool isCompressed() const;
+ /// Whether this section contains instructions.
bool isText() const;
+ /// Whether this section contains data, not instructions.
bool isData() const;
+ /// Whether this section contains BSS uninitialized data.
bool isBSS() const;
bool isVirtual() const;
bool isBitcode() const;
bool isStripped() const;
+ /// Whether this section will be placed in the text segment, according to the
+ /// Berkeley size format. This is true if the section is allocatable, and
+ /// contains either code or readonly data.
+ bool isBerkeleyText() const;
+ /// Whether this section will be placed in the data segment, according to the
+ /// Berkeley size format. This is true if the section is allocatable and
+ /// contains data (e.g. PROGBITS), but is not text.
+ bool isBerkeleyData() const;
+
bool containsSymbol(SymbolRef S) const;
relocation_iterator relocation_begin() const;
@@ -238,6 +250,8 @@ protected:
virtual bool isSectionVirtual(DataRefImpl Sec) const = 0;
virtual bool isSectionBitcode(DataRefImpl Sec) const;
virtual bool isSectionStripped(DataRefImpl Sec) const;
+ virtual bool isBerkeleyText(DataRefImpl Sec) const;
+ virtual bool isBerkeleyData(DataRefImpl Sec) const;
virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const = 0;
virtual relocation_iterator section_rel_end(DataRefImpl Sec) const = 0;
virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
@@ -449,6 +463,14 @@ inline bool SectionRef::isStripped() const {
return OwningObject->isSectionStripped(SectionPimpl);
}
+inline bool SectionRef::isBerkeleyText() const {
+ return OwningObject->isBerkeleyText(SectionPimpl);
+}
+
+inline bool SectionRef::isBerkeleyData() const {
+ return OwningObject->isBerkeleyData(SectionPimpl);
+}
+
inline relocation_iterator SectionRef::relocation_begin() const {
return OwningObject->section_rel_begin(SectionPimpl);
}