diff options
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 7f90284..39e84ff 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -1990,10 +1990,17 @@ MachOObjectFile::getSectionContents(DataRefImpl Sec) const { return getSectionContents(Offset, Size); } -Align MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const { +uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const { + uint32_t Align; + if (is64Bit()) { + MachO::section_64 Sect = getSection64(Sec); + Align = Sect.align; + } else { + MachO::section Sect = getSection(Sec); + Align = Sect.align; + } - return is64Bit() ? Align(1ULL << getSection64(Sec).align) - : Align(1ULL << getSection(Sec).align); + return uint64_t(1) << Align; } Expected<SectionRef> MachOObjectFile::getSection(unsigned SectionIndex) const { |