From ccc46bbc20dd30f2288faa3d22ed46024e36dc92 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 22 Nov 2019 14:12:50 +0000 Subject: [PATCH] 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23063 Reviewed-by: Brandon Potter Reviewed-by: Jason Lowe-Power Maintainer: Brandon Potter Tested-by: kokoro --- src/sim/syscall_emul.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 fdep = (*p->fds)[tgt_fd]; auto ffdp = std::dynamic_pointer_cast(fdep); - ObjectFile *lib = createObjectFile(ffdp->getFileName()); + auto process = tc->getProcessPtr(); + ObjectFile *lib = createObjectFile( + process->checkPathRedirect( + ffdp->getFileName())); if (lib) { lib->loadAllSymbols(debugSymbolTable, -- 2.30.2