1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Object: The default alignment of a section without alignment flags is 16.

Differential Revision: https://reviews.llvm.org/D46420

llvm-svn: 331538
This commit is contained in:
Peter Collingbourne 2018-05-04 16:45:57 +00:00
parent 96cacec873
commit 8bd01a5c11

View File

@ -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;
}
};