forked from OSchip/llvm-project
[lld/COFF] Don't round alignment if it's already a power-of-two.
This matches link.exe behaviour. Differential Revision: https://reviews.llvm.org/D26372 llvm-svn: 286553
This commit is contained in:
parent
c5bf4b831d
commit
c520e18ce0
|
@ -249,7 +249,7 @@ void SectionChunk::replace(SectionChunk *Other) {
|
||||||
CommonChunk::CommonChunk(const COFFSymbolRef S) : Sym(S) {
|
CommonChunk::CommonChunk(const COFFSymbolRef S) : Sym(S) {
|
||||||
// Common symbols are aligned on natural boundaries up to 32 bytes.
|
// Common symbols are aligned on natural boundaries up to 32 bytes.
|
||||||
// This is what MSVC link.exe does.
|
// This is what MSVC link.exe does.
|
||||||
Align = std::min(uint64_t(32), NextPowerOf2(Sym.getValue()));
|
Align = std::min(uint64_t(32), PowerOf2Ceil(Sym.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CommonChunk::getPermissions() const {
|
uint32_t CommonChunk::getPermissions() const {
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# CHECK: 3005: b8 04 10 00 40
|
# CHECK: 3005: b8 04 10 00 40
|
||||||
# CHECK: 300a: b8 20 10 00 40
|
# CHECK: 300a: b8 20 10 00 40
|
||||||
# CHECK: 300f: b8 60 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
|
--- !COFF
|
||||||
header:
|
header:
|
||||||
|
|
Loading…
Reference in New Issue