LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2018, 10:11 PM   #1
SpectralMemories
LQ Newbie
 
Registered: Apr 2018
Location: Canada
Distribution: Linux Mint
Posts: 3

Rep: Reputation: Disabled
Post 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
 
Old 04-17-2018, 10:43 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
What is the actual error message you get?
 
Old 04-18-2018, 07:18 AM   #3
SpectralMemories
LQ Newbie
 
Registered: Apr 2018
Location: Canada
Distribution: Linux Mint
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 04-18-2018, 07:50 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
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
 0x000000000000000e (SONAME)             Library soname: [libcpotlas.so.1]
 
Old 04-18-2018, 08:01 AM   #5
SpectralMemories
LQ Newbie
 
Registered: Apr 2018
Location: Canada
Distribution: Linux Mint
Posts: 3

Original Poster
Rep: Reputation: Disabled
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
 
Old 04-18-2018, 08:16 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,869
Blog Entries: 1

Rep: Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870Reputation: 1870
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
libtool --mode=link gcc -shared -version-number 0:0:1 -o librutin.la -rpath ~/lib rutin.lo
libtool --mode=install cp librutin.la ~/lib/
libtool --mode=link gcc main.c -o main ~/lib/librutin.la
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
./testSo: error while loading shared libraries: libsy.so: cannot open shared object rohaanembedded Programming 5 06-03-2013 07:23 AM
[SOLVED] error while loading shared libraries: libacl.so.1: cannot open shared object file: fl0 Slackware 4 03-22-2013 03:32 AM
honeyd: error while loading shared libraries: libdnet.1: cannot open shared object fi secbuddy Linux - Software 2 12-24-2011 02:01 PM
data sharing between c++ shared object and Fortran shared object Madhubala Debian 2 08-19-2011 02:22 AM
libXmu.so: cannot open shared object file: Too many levels of symbolic links shupi Linux - Software 2 07-05-2006 06:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration