diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -489,7 +489,9 @@ void adjustCodePadding(); /// Regular page size. - static constexpr unsigned RegularPageSize = 0x1000; + unsigned RegularPageSize{0x1000}; + static constexpr unsigned RegularPageSizeX86 = 0x1000; + static constexpr unsigned RegularPageSizeAArch64 = 0x10000; /// Huge page size to use. static constexpr unsigned HugePageSize = 0x200000; diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -101,6 +101,7 @@ InstPrinter(std::move(InstPrinter)), MIA(std::move(MIA)), MIB(std::move(MIB)), MRI(std::move(MRI)), DisAsm(std::move(DisAsm)) { Relocation::Arch = this->TheTriple->getArch(); + RegularPageSize = isAArch64() ? RegularPageSizeAArch64 : RegularPageSizeX86; PageAlign = opts::NoHugePages ? RegularPageSize : HugePageSize; }