Skip to content

Commit

Permalink
Set alignment=1 for ELF debug sections (#103867)
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Jun 24, 2024
1 parent d38e559 commit bb63e36
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private protected override void CreateSection(ObjectNodeSection section, string
{
Type = type,
Flags = flags,
Alignment = 1
},
Name = sectionName,
Stream = sectionStream,
Expand Down Expand Up @@ -689,7 +690,7 @@ private void EmitObjectFile<TSize>(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));
}
Expand Down

0 comments on commit bb63e36

Please sign in to comment.