Shared Object Cache not registering links
Hello,
I have a .so file that is successfully cached by ldconfig. It came with a link file pointing to it, so now there is two cache entry pointing to the same file. Great. But now, I tried to create another link, but this time it simply does not get cached. I tried to copy the already cached link and rename it, nothing. Am I missing something here? How do you create links to your library and get them cached by ldconfig? Thanks, I am stuck with this since last friday Alex |
What is the actual error message you get?
|
Absolutely none, thats whats the most annoying. I create the link via "ln -fs somefile.so alternativename.so", and upon using ldconfig -v, it does not output error, nor does it even try to register my link. If I rename the other link that came with the library, it gets removed from cache, and if I put it back, its cached again, like it should do. It seems my link is simply not a valid link to the ldconfig. I copied the valid link as much as possible, but it still won't register. Furthermore, this topic seems very obscure and I cannot find any ressource on that problem. Thanks for your reply
|
The bit you might have ignored is DT_SONAME attribute of the shared object. That's what matters for ldconfig, not the filename. Test:
Code:
$ readelf -d /usr/local/lib64/libcpotlas.so | grep SONAME |
Ok big thank you, this is valuable information. Do you know then why the linker forgot the link when I renamed it to something else? Does the soname have to match the filename to be linked? And if its quick to explain, how does one change the soname of a link?
Again, thank you, I needed to know that Alex |
Well, you could quote the commands you used to create the shared lib. Here is an example using libtool:
Code:
libtool --mode=compile gcc -c rutin.c |
All times are GMT -5. The time now is 08:50 AM. |