summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-10-01 21:15:06 -0700
committerGabe Black <gabeblack@google.com>2019-10-12 04:10:59 +0000
commit6ee86bf497ea87a585fe8e4651760e71244fa2fb (patch)
treeb2038b4d87285261ce57d29e82ad9e67baf99676 /src/sim/syscall_emul.hh
parent211869ea950f3cc3116655f06b1d46d3fa39fb3a (diff)
downloadgem5-6ee86bf497ea87a585fe8e4651760e71244fa2fb.tar.xz
arch,base: Separate the idea of a memory image and object file.
A memory image can be described by an object file, but an object file is more than a memory image. Also, it makes sense to manipulate a memory image to, for instance, change how it's loaded into memory. That takes on larger implications (relocations, the entry point, symbols, etc.) when talking about the whole object file, and also modifies aspects which may not need to change. For instance if an image needs to be loaded into memory at addresses different from what's in the object file, but other things like symbols need to stay unmodified. Change-Id: Ia360405ffb2c1c48e0cc201ac0a0764357996a54 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21466 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 6c3b172c2..91ddb2567 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1886,17 +1886,14 @@ mmapImpl(SyscallDesc *desc, int num, ThreadContext *tc, bool is_mmap2)
// executing inside the loader by checking the program counter value.
// XXX: with multiprogrammed workloads or multi-node configurations,
// this will not work since there is a single global symbol table.
- ObjectFile *interpreter = p->getInterpreter();
- if (interpreter) {
- if (interpreter->contains(tc->pcState().instAddr())) {
- std::shared_ptr<FDEntry> fdep = (*p->fds)[tgt_fd];
- auto ffdp = std::dynamic_pointer_cast<FileFDEntry>(fdep);
- ObjectFile *lib = createObjectFile(ffdp->getFileName());
-
- if (lib) {
- lib->loadAllSymbols(debugSymbolTable,
- lib->minSegmentAddr(), start);
- }
+ if (p->interpImage.contains(tc->pcState().instAddr())) {
+ std::shared_ptr<FDEntry> fdep = (*p->fds)[tgt_fd];
+ auto ffdp = std::dynamic_pointer_cast<FileFDEntry>(fdep);
+ ObjectFile *lib = createObjectFile(ffdp->getFileName());
+
+ if (lib) {
+ lib->loadAllSymbols(debugSymbolTable,
+ lib->buildImage().minAddr(), start);
}
}