Index: COFF/Chunks.cpp =================================================================== --- COFF/Chunks.cpp +++ COFF/Chunks.cpp @@ -249,7 +249,9 @@ CommonChunk::CommonChunk(const COFFSymbolRef S) : Sym(S) { // Common symbols are aligned on natural boundaries up to 32 bytes. // This is what MSVC link.exe does. - Align = std::min(uint64_t(32), NextPowerOf2(Sym.getValue())); + uint32_t Value = Sym.getValue(); + Align = std::min(uint64_t(32), + isPowerOf2_64(Value) ? Value : NextPowerOf2(Value)); } uint32_t CommonChunk::getPermissions() const { Index: test/COFF/common.test =================================================================== --- test/COFF/common.test +++ test/COFF/common.test @@ -7,7 +7,7 @@ # CHECK: 3005: b8 04 10 00 40 # CHECK: 300a: b8 20 10 00 40 # CHECK: 300f: b8 60 10 00 40 -# CHECK: 3014: b8 80 10 00 40 +# CHECK: 3014: b8 70 10 00 40 --- !COFF header: