diff options
author | Gabe Black <gabeblack@google.com> | 2019-10-01 21:22:07 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-10-10 22:56:52 +0000 |
commit | dd2b3bde4c3d067af68e1f2d10db81d9d0af9cb5 (patch) | |
tree | d34f7a185b92f7439dc1271e459efb57a8aa1612 /src/base/loader/elf_object.cc | |
parent | fbc32cef923893f3fae6d3ab1086a99c87b058f7 (diff) | |
download | gem5-dd2b3bde4c3d067af68e1f2d10db81d9d0af9cb5.tar.xz |
arch,base: Stop loading the interpreter in ElfObject.
The interpreter is a separate object file, and while it's convenient to
hide loading it in the code which loads the main object file, it breaks
the conceptual abstraction since you only asked it to load the main
object file.
Also, this makes every object file format reimplement the idea of
loading the interpreter. Admittedly only ELF recognizes and sets up
an interpreter, but other formats conceptually could too.
This does move that limitted hypothetical redundancy out of the object
file formats and moves it into the process objects, but I think
conceptually that's where it belongs. It would also probably be pretty
easy to add a method to the base Process class that would handle
loading an image and also the interpreter image.
This change does not (yet) separate reading symbol tables.
Change-Id: I4a165eac599a9bcd30371a162379e833c4cc89b4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21465
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/base/loader/elf_object.cc')
-rw-r--r-- | src/base/loader/elf_object.cc | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc index 4dee7d2c0..4cf20975d 100644 --- a/src/base/loader/elf_object.cc +++ b/src/base/loader/elf_object.cc @@ -464,18 +464,6 @@ ElfObject::loadWeakSymbols(SymbolTable *symtab, Addr base, Addr offset, return loadSomeSymbols(symtab, STB_WEAK, addr_mask, base, offset); } -bool -ElfObject::loadSegments(const PortProxy &mem_proxy) -{ - if (!ObjectFile::loadSegments(mem_proxy)) - return false; - - if (interpreter) - interpreter->loadSegments(mem_proxy); - - return true; -} - void ElfObject::getSections() { |