Lost Dynamic Linker Configuration on FreeBSD

Troubleshooting Dynamic Linker

In this article we will go over how you can determine if your operating system has lost its current ELF cache. In my example I will be using a FreeBSD based system so the shared ELF library cache file is located here: /var/run/ld-elf.so.hints. This is one of the files that is affected when performing the task below

Uh Oh …. The Error!

Many times when this error happens you will notice that many of you commands don’t work. They will output errors which indicate that that are missing Shared object. Below I have added an example of this when trying to run the postqueue command:

postqueue -p

/libexec/ld-elf.so.1: Shared object “libpcre.so.0″ not found, required by “postqueue”

Verifying  the issue

As a result of a Shared object not being found by the system, one way to determine if the libraries are being referenced by the dynamic linker is by running the following command:

ldconfig -r


        search directories:

The output of this will show that no directories are being referenced by the dynamic linker. This is the problem which is causing the system to not recognize the commands being input.

Reloading library paths

To reload the library paths is actually a pretty simple task. Perform the following command to reload the library paths:

/etc/rc.d/ldconfig start

Once the libraries have been loaded, running ldconfig -r will provide the proper output. I have provided an example of part of the output:

ldconfig -r | head -n 5
search directories: /lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/compat/pkg:/usr/local/lib/compat:/usr/local/lib/ffmpeg1:/usr/local/lib/mysql
0:-lalias.7 => /lib/libalias.so.7
1:-lncursesw.8 => /lib/libncursesw.so.8
2:-lavl.2 => /lib/libavl.so.2

In conclusion ….

If you ever have an issue with multiple commands on a system displaying shared objects not being found, more than likely there is issue with your how your shared libraries are being read on your system. Hopefully this provides a little insight on how to resolve this possible issue that may arise on your system.

Related Articles