LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-22-2012, 05:23 PM   #1
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
why do libraries have varied named symlinks?


hello,

from the ncurses package
Code:
/lib64/libncurses.so
/lib64/libncurses.so.5
/lib64/libncurses.so.5.7
why is it that multiple symlinks exist for the same library with an apparently ascending version number ?

regards
 
Old 06-22-2012, 05:35 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I'm willing to take an educated guess here:
Some applications are linked to the generic library name such as libncurses.so. I'd guess these are written using functions which are known to, or expected to, exist in all versions of the library the author expects to be in existence.
Some applications though might be written to use a specific function which appeared in, for example, libncurses.so.5 -- so they specify that version. obviously, though, this is a problem when the version is updated so simlinks are used until the relevant packages are likely to have been updated.
Sorry, I'm sure somebody who knows the exact process will be along soon, I just wanted to prove my ignorance.
 
1 members found this post helpful.
Old 06-22-2012, 09:33 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Exactly so!

Linux allows an application to either be "very specific" as to what library-version it wants, or very general. Let's say for the sake of example that you have versions 5.1, 5.7, and 4.9 of libcurses on your system, all at the same time. First of all, Linux is capable of handling that, "with grace and style." If an application simply asks for "libcurses," one of those symlinks will define what it will get. If it wants "libcurses 5" or "libcurses 4," ditto. And so on. The very-simple mechanism of symlinks provides the flexibility, and the loader cache (ldconfig) provides the speed.
 
1 members found this post helpful.
Old 06-22-2012, 11:44 PM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by entz View Post
hello,

from the ncurses package
Code:
/lib64/libncurses.so
/lib64/libncurses.so.5
/lib64/libncurses.so.5.7
why is it that multiple symlinks exist for the same library with an apparently ascending version number ?

regards
libfoo.so used by ld during program build
libfoo.so.X used by ld-linux when shared library is loaded
libfoo.so.X.Y - don't know. May be to show user exactly what version is used
 
Old 06-27-2012, 02:01 PM   #5
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453

Original Poster
Blog Entries: 3

Rep: Reputation: 40
thanks guys for the help

much appreciated !
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help? samengr Linux - Server 6 04-01-2009 06:22 AM
chown -R named:named /var/named crash the system? joangopan Fedora 2 09-09-2007 02:46 AM
my rootvg is varied off!!! ire.z AIX 5 09-24-2004 11:18 AM
c question: function with varied input argument blackzone Programming 1 09-12-2004 11:20 PM
Programs for displaying multiple, varied clocks? Thymox Linux - Software 4 11-01-2002 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:27 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