[lld] r263724 - [COFF] Use coff_section::getAlignment
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 17 09:58:08 PDT 2016
Author: majnemer
Date: Thu Mar 17 11:58:08 2016
New Revision: 263724
URL: http://llvm.org/viewvc/llvm-project?rev=263724&view=rev
Log:
[COFF] Use coff_section::getAlignment
Use LLVM's section alignment calculation instead of having LLD calculate
it.
Modified:
lld/trunk/COFF/Chunks.cpp
Modified: lld/trunk/COFF/Chunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.cpp?rev=263724&r1=263723&r2=263724&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.cpp (original)
+++ lld/trunk/COFF/Chunks.cpp Thu Mar 17 11:58:08 2016
@@ -34,10 +34,7 @@ SectionChunk::SectionChunk(ObjectFile *F
// Initialize SectionName.
File->getCOFFObj()->getSectionName(Header, SectionName);
- // Bit [20:24] contains section alignment. Both 0 and 1 mean alignment 1.
- unsigned Shift = (Header->Characteristics >> 20) & 0xF;
- if (Shift > 0)
- Align = uint32_t(1) << (Shift - 1);
+ Align = Header->getAlignment();
// Only COMDAT sections are subject of dead-stripping.
Live = !isCOMDAT();
More information about the llvm-commits
mailing list