LD_PRELOAD could be used to load a specific generic tiny library which on its side will load any additional library the process needs with dlopen()
service. Typically, applications able to load plugins, look into a specific directory and call dlopen()
for all the library files found into it.
You need to define an entry point in the generic library which will be triggered at loading time. With gcc
you can define this entry point with a constructor attribute:
void __attribute__ ((constructor)) lib_initialize(void);
void lib_initialize(void)
{
// Look into a specific directory to see if there are libs to
// load with dlopen()
}
This mechanism does not need any specific kernel module.
If LD_PRELOAD environment variable has too much limitations for the OP's use case, the libraries (or at least the tiny generic library discussed above) can be put in /etc/ld.so.preload. Look at the manual of ld.so, section FILES.