Linux: how to change shared library name in dynamic section of ELF binary

I have a shared library with sound: libfoo.so

How do I link my binary to libfoo.so so that the shared library name in my binary ELF section is: libfoo5.so?

I tried to create a symlink: libfoo5.so -> libfoo.so, and then linked my library as such:

g++ ... -o mybinary *.o -Lpath -lfoo5

However, when I print the dynamic section in my ELF binary, it reads:

readelf -d mybinary

I still get:

Shared library: [libfoo.so]

+3
source share
2 answers

You usually do this when creating a shared library. There is a linker option called "soname" that installs it.

, , , , , "elfutils". , ELF.

+1

libfoo5.so, , libfoo.so - . ldd ?

+1

Source: https://habr.com/ru/post/1757171/


All Articles