How can I change the filename of a shared library after building a program that depends on it?

Posted by ZorbaTHut on Stack Overflow See other posts from Stack Overflow or by ZorbaTHut
Published on 2010-05-03T15:45:10Z Indexed on 2010/05/03 15:48 UTC
Read the original article Hit count: 252

I have a program that depends on a shared library it expects to find deep inside a directory structure. I'd like to move that shared library out and into a better place. On OS X, this can be done with install_name_tool. I'm unable to find an equivalent for Linux.

For reference, readelf -d myprogram spits out the following paraphrased output:

Dynamic section at offset 0x1e9ed4 contains 30 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [this/is/terrible/library.so]
 0x00000001 (NEEDED)                     Shared library: [libGL.so.1]
 0x00000001 (NEEDED)                     Shared library: [libGLU.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]

and I would like to errata "this/is/terrible/library.so" to be "shared/library.so".

I know about RPATH and it isn't what I'm looking for, I don't need to change search paths globally.

© Stack Overflow or respective owner

Related posts about install-name-tool

Related posts about shared-libraries