I think there might be circumstances when you can't open /proc/PID/exe. I'm not sure you want failure to open it or it failing to be a readable ELF file to be hard failures.
- [PATCH] libdwfl: Make dwfl_linux_proc_attach work even with... Mark Wielaard
- Re: [PATCH] libdwfl: Make dwfl_linux_proc_attach work ... Roland McGrath
- Re: [PATCH] libdwfl: Make dwfl_linux_proc_attach w... Mark Wielaard
- Re: [PATCH] libdwfl: Make dwfl_linux_proc_atta... Mark Wielaard