From 7989460a1fba308128a7993cbabd178d2cc5ffa8 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Mon, 10 Oct 2011 21:55:43 +0000 Subject: Object: add getSectionAlignment. llvm-svn: 141581 --- llvm/lib/Object/COFFObjectFile.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/Object/COFFObjectFile.cpp') 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); -- cgit v1.2.3