base: When creating an ELF file memory image, ignore empty segments.
authorGabe Black <gabeblack@google.com>
Fri, 25 Sep 2020 07:59:12 +0000 (00:59 -0700)
committerGabe Black <gabeblack@google.com>
Fri, 25 Sep 2020 23:50:59 +0000 (23:50 +0000)
commitdd130fec927bb7860f642ed4d8e232b4cfaa521a
treeb4eb9f4fe053ad619b3af326dcdc8b4ac6bf466f
parentfe2817270ea9630c2fbc868bb093581b8a6b8a09
base: When creating an ELF file memory image, ignore empty segments.

Sometimes ELF files have segments in them which are marked as loadable,
but which actually have zero size in memory. When setting up a memory
image we should drop those to avoid confusing other code which tries
to find the footprint of a memory image. No part of these segments,
including their starting address or ending address, need to actually
land on top of memory since they don't actually contain any data.

Change-Id: If8b61d10db139e0f688b6ceabcb8e6a898557469
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35156
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/loader/elf_object.cc