Object: add getSectionAlignment.

llvm-svn: 141581
This commit is contained in:
Michael J. Spencer
2011-10-10 21:55:43 +00:00
parent 55b4e5c208
commit 7989460a1f
5 changed files with 43 additions and 0 deletions

View File

@@ -336,6 +336,15 @@ error_code COFFObjectFile::getSectionContents(DataRefImpl Sec,
return object_error::success;
}
error_code COFFObjectFile::getSectionAlignment(DataRefImpl Sec,
uint64_t &Res) const {
const coff_section *sec = toSec(Sec);
if (!sec)
return object_error::parse_failed;
Res = uint64_t(1) << (((sec->Characteristics & 0x00F00000) >> 20) - 1);
return object_error::success;
}
error_code COFFObjectFile::isSectionText(DataRefImpl Sec,
bool &Result) const {
const coff_section *sec = toSec(Sec);