From 6358e40a762b7c0e36bfbd6ef0fe01b757115dbc Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary <51944368+cjatin@users.noreply.github.com> Date: Mon, 6 Apr 2020 15:37:07 +0530 Subject: [PATCH] Removing header size from formula (#1988) Fixed a bug in the elf file size computation. --- src/hip_module.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hip_module.cpp b/src/hip_module.cpp index 2d4fde7c26..192aba5da6 100644 --- a/src/hip_module.cpp +++ b/src/hip_module.cpp @@ -1179,8 +1179,7 @@ string read_elf_file_as_string(const void* file) { auto h = static_cast(file); auto s = static_cast(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}; }