What is the difference between LD_PRELOAD_PATH and LD_LIBRARY_PATH?

What is the difference between LD_PRELOAD_PATH and LD_LIBRARY_PATH?

I understand what they do, but not the details of how they differ.

From http://en.wikipedia.org/wiki/Dynamic_linker

A dynamic linker can be influenced by a change in its behavior during program execution or communication with the program. Examples of this can be seen on the runtime linker manual pages for various Unix-like systems. A typical modification to this behavior is the use of LD_LIBRARY_PATH and LD_PRELOAD environment variables. These variables control the binding of the execution time of the process by searching for shared libraries in different places and by forcing loading and linking libraries that would not otherwise be, respectively.

In particular, I'm interested in the differences in Linux that have LD_PRELOAD_PATH and LD_LIBRARY_PATH:

http://linuxgazette.berlios.de/issue48/tag/48.html

+8
linker shared-libraries
source share
1 answer

LD_PRELOAD (not LD_PRELOAD_PATH ) is a list of specific libraries (files) that need to be loaded in front of any other libraries, regardless of whether it wants the program or not. LD_LIBRARY_PATH is a list of directories to search for when loading libraries that would be loaded anyway. On linux, you can read man ld.so for more information on these and other environment variables that affect the dynamic linker.

+11
source share

All Articles