sim-se: Check Path redirection when mmapping
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 22 Nov 2019 14:12:50 +0000 (14:12 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 27 Nov 2019 09:44:41 +0000 (09:44 +0000)
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>
src/sim/syscall_emul.hh

index 2d4ef25fd39d97a7adef9548a7dae51e7dfac275..0eaec4c1fc6fa6db0c67dbdae91625ebaab34de9 100644 (file)
@@ -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,