diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ElfObjectWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ElfObjectWriter.cs index 503985d92934e..2cd90d06977e0 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ElfObjectWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ElfObjectWriter.cs @@ -141,6 +141,7 @@ private protected override void CreateSection(ObjectNodeSection section, string { Type = type, Flags = flags, + Alignment = 1 }, Name = sectionName, Stream = sectionStream, @@ -689,7 +690,7 @@ private void EmitObjectFile(FileStream outputFileStream) { _stringTable.ReserveString(section.Name); - if (section.SectionHeader.Alignment > 0) + if (section.SectionHeader.Alignment > 1) { currentOffset = (ulong)((currentOffset + (ulong)section.SectionHeader.Alignment - 1) & ~(ulong)(section.SectionHeader.Alignment - 1)); }