-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
patchefd --set-rpath ... nodejs
broken since ~0.17.2 (0.15.0 works)
#531
Comments
patchefd --set-rpath ... nodejs
broken since ~0.17.2 (15.0 works)patchefd --set-rpath ... nodejs
broken since ~0.17.2 (0.15.0 works)
Alright, got it! The issue is that
... which patchelf, when growing the program header table, moves somewhere else (which also changes its virtual memory address, aii aii!). Relocating this section (at least without relocating all the other sections) is illegal, because the underlying assembly might use (and, in this case, does use) RIP-relative addressing, which breaks when the sections are shuffled around in the memory like that. tl;dr patchelf changes memory address of an *.elf section that is supposed to be non-movable I wonder if instead of extending the PHDR we could just allocate a new one, at the end of the file? This wouldn't cause this mayhem; I'll try playing with that. Edit: I should perhaps also mention that allocating |
Ah, we extend PHDR instead of allocating a new one due to a Linux bug: Line 1 in 7c2f768
Considering the commit is from 2005, hopefully that's not the case anymore! |
Describe the bug
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib node
produces broken executable withpatchelf-0.17.2
andpatchelf-0.18.0
, no problem withpatchelf-0.15.0
the resulting executables crash with Segmentation Failed
ldd node
produces no output at allSteps To Reproduce
node
is from this archive: https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.gzThen run
patchelf --set-rpath ${stdenv.cc.cc.lib}/lib node
where${stdenv.cc.cc.lib}
is the path to gcc libs path on your systemExpected behavior
Expected working executable as it was with
patchelf-0.15.0
patchelf --version
output0.17.2, 0.18.0
Additional context
Downloaded
node
may seems ridiculous example, but using downloadednode
andprotoc
it is an usual part of Maven build process.BTW, there was no problem with patching
protoc
with anypatchelf
versionThe text was updated successfully, but these errors were encountered: