aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-10 21:55:43 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-10 21:55:43 +0000
commite2f2f07be7cf2b55b7e5501291bbcede87e43fd6 (patch)
treea06d237ac604c3850bb6e509f76aa0ae13a6a15a /lib/Object/COFFObjectFile.cpp
parent023bb15beaac3744ce3a5d1f750d6e32829c7130 (diff)
downloadexternal_llvm-e2f2f07be7cf2b55b7e5501291bbcede87e43fd6.tar.gz
external_llvm-e2f2f07be7cf2b55b7e5501291bbcede87e43fd6.tar.bz2
external_llvm-e2f2f07be7cf2b55b7e5501291bbcede87e43fd6.zip
Object: add getSectionAlignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/COFFObjectFile.cpp')
-rw-r--r--lib/Object/COFFObjectFile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index 91492db2f0..e84eb914fc 100644
--- a/lib/Object/COFFObjectFile.cpp
+++ b/lib/Object/COFFObjectFile.cpp
@@ -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);