I have a question on using dlopen. The situation is as follows.
From my app at runtime, I do dlopen a library ValService.so. This .so
has many other shared libraries linked to it. So when I do a dlopen on
ValService.so, all the other libraries are also loaded. After this, I
do a dlsym on the library and execute the function. This works fine.
Now we are trying to patch the library (ValService.so). So I Identify
the method that needs to be patched and have the correct
implementation in a source file and then build a .so out of this
source file. Then at runtime I specify this new patch file in the
LD_PRELOAD environemnt. This works fine, when the new patch source
file does not refer any other libraries (linked to the main
ValService.so). When there are dependencies, the application fails at
startup time, with an error message from ld.so complaining abt
unresolved symbols. The question is how do I patch the dynamic
library. I donot want to rebuild the whole library.
I tried to dlopen the patch library before dlopening the main
library (ValService.so). This also did not help. I get unresolved
symbols error when I dlopen the patch library.
I would appreciate if anyone can help me with this.