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 @@ -48,7 +48,7 @@ namespace opts { -cl::opt NoHugePages("no-huge-pages", +cl::opt NoHugePages("no-huge-pages", cl::init(true), cl::desc("use regular size pages for code alignment"), cl::Hidden, cl::cat(BoltCategory)); diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -1777,7 +1777,10 @@ opts::UseOldText = false; } - if (!opts::AlignText.getNumOccurrences()) + if (opts::Hugify || opts::HotText) + BC->PageAlign = BinaryContext::HugePageSize; + + if (opts::Hugify || opts::UseOldText) opts::AlignText = BC->PageAlign; if (opts::AlignText < opts::AlignFunctions) diff --git a/bolt/lib/Utils/CommandLineOpts.cpp b/bolt/lib/Utils/CommandLineOpts.cpp --- a/bolt/lib/Utils/CommandLineOpts.cpp +++ b/bolt/lib/Utils/CommandLineOpts.cpp @@ -42,7 +42,7 @@ cl::opt AlignText("align-text", cl::desc("alignment of .text section"), cl::Hidden, - cl::cat(BoltCategory)); + cl::init(64), cl::cat(BoltCategory)); cl::opt AlignFunctions( "align-functions", diff --git a/bolt/test/X86/dummy-eh-frame-bug.s b/bolt/test/X86/dummy-eh-frame-bug.s --- a/bolt/test/X86/dummy-eh-frame-bug.s +++ b/bolt/test/X86/dummy-eh-frame-bug.s @@ -9,7 +9,7 @@ ## after .text when no update is needed to .eh_frame. # CHECK: {{ .text}} PROGBITS [[#%x,ADDR:]] [[#%x,OFFSET:]] [[#%x,SIZE:]] -# CHECK-NEXT: 0000000000000000 [[#%x, OFFSET + SIZE]] +# CHECK-NEXT: 0000000000000000 [[#%.6x, OFFSET + SIZE]] .text .globl nocfi_function