diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp --- a/lld/MachO/SyntheticSections.cpp +++ b/lld/MachO/SyntheticSections.cpp @@ -1899,6 +1899,7 @@ InitOffsetsSection::InitOffsetsSection() : SyntheticSection(segment_names::text, section_names::initOffsets) { flags = S_INIT_FUNC_OFFSETS; + align = 4; // This section contains 32-bit integers. } uint64_t InitOffsetsSection::getSize() const { diff --git a/lld/test/MachO/init-offsets.s b/lld/test/MachO/init-offsets.s --- a/lld/test/MachO/init-offsets.s +++ b/lld/test/MachO/init-offsets.s @@ -27,7 +27,7 @@ # FLAGS-NEXT: addr # FLAGS-NEXT: size 0x0000000000000010 # FLAGS-NEXT: offset -# FLAGS-NEXT: align +# FLAGS-NEXT: align 2^2 (4) # FLAGS-NEXT: reloff 0 # FLAGS-NEXT: nreloc 0 # FLAGS-NEXT: type S_INIT_FUNC_OFFSETS