Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between .so.0 and .so.0.0.0 files

Tags:

linux

Im using a market data source implementation that contains .so.0 files. However these are 'soft links' to actual .so.0.0.0 files. Why is this done?

When I try to copy these .so.0 links, it ends up copying an exact replica of the .so.0.0.0 file but with a .so.0 prefix.

Added comment:

so I have a libfoo.so file, and it is being accessed by java through jni. This libfoo.so file is actually a soft link that points to libfoo.so.0.0.0 What happens if I don't have libfoo.so. How does java/or any other compiled code, figure out that libfoo.so.0.0.0 if the shared object to use?

like image 267
user242591 Avatar asked Jan 05 '10 03:01

user242591


2 Answers

This is so programs can bind to either any version of libfoo that has the same interface (I want the latest updates to libfoo), or bind to a specific version (I want stability and only the exact version I tested against).

like image 199
Ana Betts Avatar answered Sep 24 '22 01:09

Ana Betts


The .0 and .0.0.0 files exist so that versioning can happen:

  • foo.0 represents the .0 version of a library. All .0 versions of the library will use the same interface, but there may be different implementations. (Hopefully, the later implementations will have fewer bugs than the earlier ones.)

  • foo.0.0.0 represents a specific implementation of the .0 version.

It's not useful, now, to have the soft-link. But here's what could happen:

The programmer of foo finds a bug in his library. He releases foo.0.0.1. And foo.0 now links to foo.0.0.1. Then two things happen:

  • All files that link to foo.0 will automatically update to foo.0.0.1.
  • All files that link to foo.0.0.0 will continue to use the old foo.0.0.0
like image 43
Chip Uni Avatar answered Sep 25 '22 01:09

Chip Uni