Reduced file size when data is empty
This commit is contained in:
parent
824efbf424
commit
733c12d413
@ -81,6 +81,9 @@ func (elf *ELF) Write(writer io.Writer) {
|
|||||||
binary.Write(writer, binary.LittleEndian, &elf.DataHeader)
|
binary.Write(writer, binary.LittleEndian, &elf.DataHeader)
|
||||||
writer.Write(elf.CodePadding)
|
writer.Write(elf.CodePadding)
|
||||||
writer.Write(elf.Code)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user