Removing header size from formula (#1988)

Fixed a bug in the elf file size computation.
Dieser Commit ist enthalten in:
Jatin Chaudhary verfasst und GitHub committed 2020-04-06 15:37:07 +05:30
1 Ursprung 6c65fc04d1
Commit 6358e40a76
1 Datei geändert
+1 -2
+1 -2
Datei anzeigen
@@ -1179,8 +1179,7 @@ string read_elf_file_as_string(const void* file) {
auto h = static_cast<const ELFIO::Elf64_Ehdr*>(file);
auto s = static_cast<const char*>(file);
// This assumes the common case of SHT being the last part of the ELF.
auto sz =
sizeof(ELFIO::Elf64_Ehdr) + h->e_shoff + h->e_shentsize * h->e_shnum;
auto sz = h->e_shoff + h->e_shentsize * h->e_shnum;
return string{s, s + sz};
}