Skip to content
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

--set-interpreter problem (ubuntu 14 64 bits) #90

Open
YannSuissa opened this issue Apr 6, 2016 · 1 comment
Open

--set-interpreter problem (ubuntu 14 64 bits) #90

YannSuissa opened this issue Apr 6, 2016 · 1 comment

Comments

@YannSuissa
Copy link

Hi,

Here is what i do :

patchelf --set-interpreter libs_myexe/ld-linux-x86-64.so.2 ./myexe

After it i check with :

ldd myexe | grep ld-linux
libs_myexe/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007f2b025b4000)

It doesn't use the right on when i start the program, because the new path should be the contrary?
ie : /lib64/ld-linux-x86-64.so.2 => libs_myexe/ld-linux-x86-64.so.2

I do something wrong?
Thanks

@mburr
Copy link

mburr commented Sep 2, 2016

I think that what's happening is that ldd is a script that ultimately runs /lib64/ld-linux-x86-64.so.2 to produce the output about the library dependencies. The line of output that mentions ld-linux will always report the /lib64/ld-linux-x86-64.so.2 as the target because it's the loader that is actually loaded and running when you invoke ldd.

See http://unix.stackexchange.com/a/76514/7084 for some more details.

Use

readelf -l  myexe  | grep interpreter

to reliably see what's in the executable file, and use ls -l on what's displayed there if you want to know if and what the name is ultimately linked to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants