diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-12-10 20:46:55 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-12-10 20:46:55 +0000 |
commit | 0e77a94fd679004f9881372c2c71e0b952b20d3f (patch) | |
tree | c26de07e541a6d285e2a18f9efbdc7baa1d25246 /llvm/lib/Object/MachOObjectFile.cpp | |
parent | 87a559212bb345c81776eea4be9fb2adc10f24e3 (diff) | |
download | bcm5719-llvm-0e77a94fd679004f9881372c2c71e0b952b20d3f.tar.gz bcm5719-llvm-0e77a94fd679004f9881372c2c71e0b952b20d3f.zip |
Move three methods only used by MCJIT to MCJIT.
These methods are only used by MCJIT and are very specific to it. In fact, they
are also fairly specific to the fact that we have a dynamic linker of
relocatable objects.
llvm-svn: 223964
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index c6fb0874842..0c5b180941e 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -316,6 +316,12 @@ std::error_code MachOObjectFile::getSymbolName(DataRefImpl Symb, return object_error::success; } +unsigned MachOObjectFile::getSectionType(SectionRef Sec) const { + DataRefImpl DRI = Sec.getRawDataRefImpl(); + uint32_t Flags = getSectionFlags(this, DRI); + return Flags & MachO::SECTION_TYPE; +} + // getIndirectName() returns the name of the alias'ed symbol who's string table // index is in the n_value field. std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb, @@ -575,32 +581,11 @@ bool MachOObjectFile::isSectionBSS(DataRefImpl Sec) const { SectionType == MachO::S_GB_ZEROFILL); } -bool MachOObjectFile::isSectionRequiredForExecution(DataRefImpl Sect) const { - // FIXME: Unimplemented. - return true; -} - bool MachOObjectFile::isSectionVirtual(DataRefImpl Sec) const { // FIXME: Unimplemented. return false; } -bool MachOObjectFile::isSectionZeroInit(DataRefImpl Sec) const { - uint32_t Flags = getSectionFlags(this, Sec); - unsigned SectionType = Flags & MachO::SECTION_TYPE; - return SectionType == MachO::S_ZEROFILL || - SectionType == MachO::S_GB_ZEROFILL; -} - -bool MachOObjectFile::isSectionReadOnlyData(DataRefImpl Sec) const { - // Consider using the code from isSectionText to look for __const sections. - // Alternately, emit S_ATTR_PURE_INSTRUCTIONS and/or S_ATTR_SOME_INSTRUCTIONS - // to use section attributes to distinguish code from data. - - // FIXME: Unimplemented. - return false; -} - bool MachOObjectFile::sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb) const { SymbolRef::Type ST; |