From: Gabe Black Date: Wed, 2 Oct 2019 02:26:12 +0000 (-0700) Subject: base: ELF segment types are not bitfields. X-Git-Tag: v19.0.0.0~474 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e4ed0d84013a36dda19dd93d6b883d7d2984d600;p=gem5.git base: ELF segment types are not bitfields. The ELF segment type had been checked by bitwise &-ing it with the PT_LOAD constant to check if it was loadable. This is incorrect. The value is a flat integer, with different values selecting different types of segments. Change-Id: I644dd985bda4ad2d992557c90ffe8048c0ae6aac Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21460 Tested-by: kokoro Reviewed-by: Anthony Gutierrez Maintainer: Anthony Gutierrez --- diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc index 654cb33d5..2a8fb04ea 100644 --- a/src/base/loader/elf_object.cc +++ b/src/base/loader/elf_object.cc @@ -342,7 +342,7 @@ ElfObject::ElfObject(const std::string &_filename, size_t _len, } // for now we don't care about non-loadable segments - if (!(phdr.p_type & PT_LOAD)) + if (phdr.p_type != PT_LOAD) continue; ldMin = std::min(ldMin, phdr.p_vaddr);