[PATCH] D26372: [COFF] Don't round alignment if it's already a power-of-two
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 19:03:42 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286553: [lld/COFF] Don't round alignment if it's already a power-of-two. (authored by davide).
Changed prior to commit:
https://reviews.llvm.org/D26372?vs=77107&id=77590#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26372
Files:
lld/trunk/COFF/Chunks.cpp
lld/trunk/test/COFF/common.test
Index: lld/trunk/test/COFF/common.test
===================================================================
--- lld/trunk/test/COFF/common.test
+++ lld/trunk/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:
Index: lld/trunk/COFF/Chunks.cpp
===================================================================
--- lld/trunk/COFF/Chunks.cpp
+++ lld/trunk/COFF/Chunks.cpp
@@ -249,7 +249,7 @@
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()));
+ Align = std::min(uint64_t(32), PowerOf2Ceil(Sym.getValue()));
}
uint32_t CommonChunk::getPermissions() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26372.77590.patch
Type: text/x-patch
Size: 906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161111/5568d85e/attachment.bin>
More information about the llvm-commits
mailing list