elf2hex writes zeros to a segment for which MemSize > FileSize, which adheres to the ELF spec. Thus, we should calculate the total size of the file from the MemSize of the last segment, rather than the FileSize.
elf2hex writes zeros to a segment for which MemSize > FileSize, which adheres to the ELF spec. Thus, we should calculate the total size of the file from the MemSize of the last segment, rather than the FileSize.