From 93bbc7cd66aa98120a8b0411d90a619aec8df6e3 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 17 Mar 2016 16:58:08 +0000 Subject: [PATCH] [COFF] Use coff_section::getAlignment Use LLVM's section alignment calculation instead of having LLD calculate it. llvm-svn: 263724 --- lld/COFF/Chunks.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp index aef36bb..0f95525 100644 --- a/lld/COFF/Chunks.cpp +++ b/lld/COFF/Chunks.cpp @@ -34,10 +34,7 @@ SectionChunk::SectionChunk(ObjectFile *F, const coff_section *H) // 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(); -- 2.7.4