diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-11-22 14:12:50 +0000 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-11-27 09:44:41 +0000 |
commit | ccc46bbc20dd30f2288faa3d22ed46024e36dc92 (patch) | |
tree | b0aabdb1764d07ec3edbbdbe9d72617a9dd9afd1 | |
parent | 5441dd19ed410f5d60da409de5ffb9c508d368c6 (diff) | |
download | gem5-ccc46bbc20dd30f2288faa3d22ed46024e36dc92.tar.xz |
sim-se: Check Path redirection when mmapping
Every syscall file access should go through the redirection process
Change-Id: I1ba2063b5a254e11f47392bdad0bf0887ba73d3d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23063
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
-rw-r--r-- | src/sim/syscall_emul.hh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 2d4ef25fd..0eaec4c1f 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1890,7 +1890,10 @@ mmapImpl(SyscallDesc *desc, int num, ThreadContext *tc, bool is_mmap2) 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()); + auto process = tc->getProcessPtr(); + ObjectFile *lib = createObjectFile( + process->checkPathRedirect( + ffdp->getFileName())); if (lib) { lib->loadAllSymbols(debugSymbolTable, |