[llvm] r331538 - Object: The default alignment of a section without alignment flags is 16.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Fri May 4 09:45:58 PDT 2018
Author: pcc
Date: Fri May 4 09:45:57 2018
New Revision: 331538
URL: http://llvm.org/viewvc/llvm-project?rev=331538&view=rev
Log:
Object: The default alignment of a section without alignment flags is 16.
Differential Revision: https://reviews.llvm.org/D46420
Modified:
llvm/trunk/include/llvm/Object/COFF.h
Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=331538&r1=331537&r2=331538&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Fri May 4 09:45:57 2018
@@ -452,11 +452,12 @@ struct coff_section {
if (Characteristics & COFF::IMAGE_SCN_TYPE_NO_PAD)
return 1;
- // Bit [20:24] contains section alignment. Both 0 and 1 mean alignment 1.
+ // Bit [20:24] contains section alignment. 0 means use a default alignment
+ // of 16.
uint32_t Shift = (Characteristics >> 20) & 0xF;
if (Shift > 0)
return 1U << (Shift - 1);
- return 1;
+ return 16;
}
};
More information about the llvm-commits
mailing list