Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update the patchelf tool from v0.14.2 to v0.18.0.
In particular, this fixes ELF corruption on
x64-linux-dynamic
with RPATH rewriting, which manifests itself as odd segfaults on initial binary execution, or library dependencies being messed up (eg. the binary depends onlibfoo.1.2.3
(& objdump/ldd/readelf displaying as such) but the runtime linker tries to load a truncatedlibf
).eu-elflint
reports errors likesection [ 6] '.dynstr' not fully contained in segment of program header entry 2
The issues don't seem to affect all architectures and distributions evenly — eg. Fedora is much more likely to encounter runtime errors than Debian (with the same binary), as are amd64 binaries cf arm64: maybe there's some differing glibc behaviours/options at play? Presumably may depend on build path lengths and other fun variables too.
Relevant upstream issues:
normalizeNoteSegments
causes.dynstr
not to be contained fully in a segment NixOS/patchelf#403staging-next
NixOS/patchelf#482 (fixed in Resize segment mapping rewritten sections if needed #482 NixOS/patchelf#485)