Skip to contentSkip to conversation

linux-user: look up executable in emulation dir for execve syscall

PATCH In review Andreas Schwab 2 participants 3 messages Nov 25, 2025 – Jan 26

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: look up executable in emulation dir for execve syscall

---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
index f7ca155679..e379ddb1b7 100644
@@ -8972,6 +8972,7 @@ static int do_execv(CPUArchState *cpu_env, int dirfd,
     if (is_proc_myself(p, "exe")) {
         exe = exec_path;
     }
+    exe = path(exe);
     ret = is_execveat
         ? safe_execveat(dirfd, exe, argp, envp, flags)
         : safe_execve(exe, argp, envp);
Signature · 7 lines
2.52.0


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#1 lore raw

Hello Andreas,

could you maybe explain why this is needed?
Did you face a real problem?

Helge

Quoted 17 lines · Andreas Schwab
---
  linux-user/syscall.c | 1 +
  1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
index f7ca155679..e379ddb1b7 100644
@@ -8972,6 +8972,7 @@ static int do_execv(CPUArchState *cpu_env, int dirfd,
      if (is_proc_myself(p, "exe")) {
          exe = exec_path;
      }
+    exe = path(exe);
      ret = is_execveat
          ? safe_execveat(dirfd, exe, argp, envp, flags)
          : safe_execve(exe, argp, envp);
#2 lore raw
Quoted 2 lines · Helge Deller

could you maybe explain why this is needed?
Did you face a real problem?

It allows the target to find the executable in the target sysroot.

Signature · 3 lines
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."