That patch will copy the whole of the target executable into a temporary file without changing any of it -- the fake_open mechanism is really intended for cases where we need to return modified results. Wouldn't it be easier to just have something in do_open() that said: if (is_proc_myself(pathname, "exe")) { return get_errno(open(exec_path), flags, mode); }
That will then give the right behaviour for read-only executables and other error-related corner cases. (See also the logic in the readlink/readlinkat handling which already specialcases /proc/self/exe using exec_path.) -- 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