"Sometimes, you might want to determine what is happening in a
shared library without modifying the library (have you tried to
build glibc lately?). Other times, you might want to override only
a few functions within a library and get them to do something
else--force a process to a specific CPU, prevent a specific USB
message from being sent and so on. All of these tasks are possible
if you use the LD_PRELOAD environment variable and a small shim
program placed between the application and the library.
"As an example, say you create a shared library object called
shim.so and want it to be loaded before any other shared library.
Say you also want to run the program 'test...'"
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.