Shared object (so) files search paths

1

What is the sequence of paths that are searched for loading a shared object file?

I am trying to run a executable which tries to load a shared object file. The shared object file can be found at /usr/lib/x86_64-linux-gnu/.

I have two users, let's call them user1 and user2. user1 can run the executable but user2 encounters the error: cannot open the shared object file: libicuuc.so

Both the users have the same LD_LIBRARY_PATH. What is mising?

Mukul Gupta

Posted 2016-04-18T11:16:10.413

Reputation: 113

1Does user2 have the correct rights to read libicuuc.so? – DavidPostill – 2016-04-18T11:23:00.953

Yes, user2 can read libicuuc.so. – Mukul Gupta – 2016-04-18T12:17:34.543

It turns out that user2 was trying to run a 32 bit executable for a different distro. ldd helped debug the issue. Thanks! – Mukul Gupta – 2016-04-18T15:10:42.190

Answers

1

man ldconfig may help you

/etc/ld.so.cache    File  containing an ordered list of libraries found
                    in the directories specified in /etc/ld.so.conf, as
                    well as those found in /lib and /usr/lib.

but your distrib may contain other info than mine, so you should read yours.

Another way to decide what/which libraries are bound to your executable is to use the ldd program An example:

ldd /bin/echo
        linux-vdso.so.1 =>  (0x00007ffc2277a000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003edc200000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003edbe00000)

Gombai Sándor

Posted 2016-04-18T11:16:10.413

Reputation: 3 325