summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit7989460a1fba308128a7993cbabd178d2cc5ffa8 (patch)
tree9a9140e6b83555d05c3eed2d27d8164545654f5f /llvm/lib/Object/COFFObjectFile.cpp
parent55b4e5c208d614c71347d74069ff5a70a6c4ddcf (diff)
downloadbcm5719-llvm-7989460a1fba308128a7993cbabd178d2cc5ffa8.tar.gz
bcm5719-llvm-7989460a1fba308128a7993cbabd178d2cc5ffa8.zip
Object: add getSectionAlignment.
llvm-svn: 141581
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 91492db2f0d..e84eb914fc7 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud