-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid header generated when modifying rpath with v1.6.1 #426
Comments
Here's a g++ binary with (probably) the same problem. Call "patchelf --set-rpath /cs/re/buildchain_ubuntufocal/lib ./g++" on it with patchelf 1.5.0, and it works. With 1.6.1, it breaks the same way as reported by OP. |
I noticed when debugging ia64 that in some cases replaced sections were re-ordered when extending the rpath. |
I cannot reproduce this on almalinux with patchelf master (commit 78a2a70)
|
Describe the bug
We use
patchelf
to add rpath to a Python executable (literallypython3.8
) that we compile ourselves in order to find the libraries we ship in nearby directories. We use thepatchelf
package from PyPi that got recently updated from v15.0 to v16.1, when that happened the patched Python executable stopped working on AlmaLinux 8.6. We use CentOS 7.3 internally and for all our builds, everything works fine in there, but on CentOS 8.2 or AlmaLinux 8.6 the executable segfaults immediately.We figured out it was probably an header problem because it was failing immediately and the two executables only differed in the header. Here I past the output of
readelf -l python3.8
, that shows some differences between the executables patched with the two version ofpatchelf
.Working:
Broken:
I do not know much about ELF headers, so I did not investigate further. I hope this output already provides a hint to identify the issue, let me know how to provide more useful information if needed.
Steps To Reproduce
Execute the following command on CentOS 7.3 with patchelf v1.6.1:
patchelf --set-rpath '$$ORIGIN/../lib:$$ORIGIN/../../lib/pinned-libs' ${INSTALLER_BUILD_DIR}/foopython/bin/python3.8
Execute
python3.8
on AlmaLinux 8.6.Expected behavior
Python starts.
The text was updated successfully, but these errors were encountered: