Some nits: The "(CPUArchState *)" cast isn't necessary We should use exec_path, not ts->bprm->argv[0] (the guest argv[0] isn't necessarily the executable path) We don't want to call path() here -- exec_path is a host path, and only guest filename paths need to go through path().
Looking a little more closely at the logic in main.c I wonder if we actually want: if (is_proc_myself(pathname, "exe")) { execfd = qemu_getauxval(AT_EXECFD); if (execfd) { return execfd; } return get_errno(open(exec_path, flags, mode)); } Also if you'd like us to apply your patches we'll need at least a "Signed-off-by: " line from you. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1299190 Title: Access to /proc/self/exe in linux-user mode Status in QEMU: New Bug description: This is based on a recent bug in GCC Bugzilla: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60681 It looks like libbacktrace (GCC runtime library used for obtaining stack traces) uses /proc/self/exe for error reporting. Currently this is mapped to qemu-arm which effectively disables libbacktrace on linux-user. It seems that QEMU already supports /proc/self/{maps,stat,auxv} so addition of /proc/self/exe may be trivial. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1299190/+subscriptions