From 511391feaa67ed28f5c244acdbdd547ae7e379cc Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 17 Mar 2016 16:55:18 +0000 Subject: [COFF] Refactor section alignment calculation Section alignment isn't completely trivial, let it live in one place so that we may reuse it in LLVM. llvm-svn: 263722 --- llvm/lib/Object/COFFObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/COFFObjectFile.cpp') diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index 4cd6aff5f17..25145471382 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -290,7 +290,7 @@ std::error_code COFFObjectFile::getSectionContents(DataRefImpl Ref, uint64_t COFFObjectFile::getSectionAlignment(DataRefImpl Ref) const { const coff_section *Sec = toSec(Ref); - return uint64_t(1) << (((Sec->Characteristics & 0x00F00000) >> 20) - 1); + return Sec->getAlignment(); } bool COFFObjectFile::isSectionText(DataRefImpl Ref) const { -- cgit v1.2.3