-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
patchelf apparently doesn't update _DYNAMIC symbol? #75
Comments
Here is an example of what I'm talking about on a trivial "Hello, World" executable. Before:
So this shows that the Then if I run patchelf on this binary, we'll see this change:
So the section has now been relocated, both in the file and in virtual address space. The debugging symbol |
I suspect this behavior is related to this "FIXME" comment in
Presumably |
This fix would probably look something a little like:
...however, that only works for the special case that the symbol points to the beginning of the beginning of the section. What we really want is something that looks like:
I dug around and its not clear if the original address of the section is kept around anywhere though... |
Alright, got some progress here! As it turns out, updating the symbol is not sufficient, because at least GCC-generated code seems to also rely on the Somewhat unfortunately, this doesn't actually fix the underlying issue with NodeJS (and pcloud, in my case), so on to investigating further 🔍 |
Wow, good job finding this old bug. Hope the info in it helped. I can't be of much assistance to verifying your fix since I filed this in reference to a problem I hit at my day job... which I left 4 years ago. I don't have access to the codebase where I was seeing this problem occur. |
I was trying to make a function that determined if a program had already the correct runpath set (don't ask...) This should be possible by inspecting the
_DYNAMIC
symbol as show here and just looking at my ownd_tag == DT_RUNPATH
entry:http://stackoverflow.com/a/2846736
However, after running a binary through patchelf, it seems like the
_DYNAMIC
symbol points to garbage? I haven't investigated more, but I suspect that it just isn't updating that symbol after replacing that ELF header section... if that's the case than probably some other programs that are trying to be clever with_DYNAMIC
-introspectionThe text was updated successfully, but these errors were encountered: