elfexec
elfexec copied to clipboard
Not working with PyInstaller
# cat h.py
print('hello')
# pyinstaller -F -c h.py
...
# cat ./dist/h | elfexec
[1518521] Cannot open PyInstaller archive from executable (/memfd:elfexec (deleted)) or external archive (/memfd:elfexec (deleted).pkg)
PyInstaller use bootloader and try to open executed file itself via /proc/self/exe to unpack it to temppath/_MEIxxxxxx. But if you cat-ing executable file, where is no file on disk to open:
readlink("/proc/self/exe", "/memfd:elfexec (deleted)", 4095) = 24
openat(AT_FDCWD, "/memfd:elfexec (deleted)", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/memfd:elfexec (deleted).pkg", O_RDONLY) = -1 ENOENT (No such file or directory)
I have no idea how to workaround it with PyInstaller binaries.