diff --git a/src/build/elf/ELF.go b/src/build/elf/ELF.go index a2b1e4a..1cc8b57 100644 --- a/src/build/elf/ELF.go +++ b/src/build/elf/ELF.go @@ -81,6 +81,9 @@ func (elf *ELF) Write(writer io.Writer) { binary.Write(writer, binary.LittleEndian, &elf.DataHeader) writer.Write(elf.CodePadding) writer.Write(elf.Code) - writer.Write(elf.DataPadding) - writer.Write(elf.Data) + + if len(elf.Data) > 0 { + writer.Write(elf.DataPadding) + writer.Write(elf.Data) + } }