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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223964 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-12-10 20:46:55 +00:00
parent 446f01b1d5
commit c0e334099c
7 changed files with 64 additions and 98 deletions

View File

@ -362,39 +362,11 @@ bool COFFObjectFile::isSectionBSS(DataRefImpl Ref) const {
return Sec->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA;
}
bool COFFObjectFile::isSectionRequiredForExecution(DataRefImpl Ref) const {
// Sections marked 'Info', 'Remove', or 'Discardable' aren't required for
// execution.
const coff_section *Sec = toSec(Ref);
return !(Sec->Characteristics &
(COFF::IMAGE_SCN_LNK_INFO | COFF::IMAGE_SCN_LNK_REMOVE |
COFF::IMAGE_SCN_MEM_DISCARDABLE));
}
bool COFFObjectFile::isSectionVirtual(DataRefImpl Ref) const {
const coff_section *Sec = toSec(Ref);
return Sec->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA;
}
bool COFFObjectFile::isSectionZeroInit(DataRefImpl Ref) const {
const coff_section *Sec = toSec(Ref);
return Sec->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA;
}
bool COFFObjectFile::isSectionReadOnlyData(DataRefImpl Ref) const {
const coff_section *Sec = toSec(Ref);
// Check if it's any sort of data section.
if (!(Sec->Characteristics & (COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA |
COFF::IMAGE_SCN_CNT_INITIALIZED_DATA)))
return false;
// If it's writable or executable or contains code, it isn't read-only data.
if (Sec->Characteristics &
(COFF::IMAGE_SCN_CNT_CODE | COFF::IMAGE_SCN_MEM_EXECUTE |
COFF::IMAGE_SCN_MEM_WRITE))
return false;
return true;
}
bool COFFObjectFile::sectionContainsSymbol(DataRefImpl SecRef,
DataRefImpl SymbRef) const {
const coff_section *Sec = toSec(SecRef);