Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9214127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:54:26+00:00 2026-06-18T01:54:26+00:00

I learned the Program Library HOWTO . It mention that using soname to manage

  • 0

I learned the “Program Library HOWTO“. It mention that using soname to manage the version like follow.

gcc -shared -fPIC -Wl,-soname,libfoo.so.1  -o libfoo.so.1.0.0 foo.c
ln -s libfoo.so.1.0.0  libfoo.so.1
ln -s libfoo.so.1 libfoo.so

And I get the information that if the soname is not set. it will be equal to libfoo.so.1.0.0 ,see the answer from here.

And I find that it also can work without soname , like following

 gcc -shared -fPIC -o libfoo.so.1.0.0 foo.c
 ln -s libfoo.so.1.0.0  libfoo.so.1
 ln -s libfoo.so.1 libfoo.so

So I think that the only one useful point is that the soname option can tell you the version of the shared library when you use readelf -d libfoo.so command to check it.

What else can it do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:54:27+00:00Added an answer on June 18, 2026 at 1:54 am

    soname is used to indicate what binary api compatibility your library support.

    SONAME is used at compilation time by linker to determine from the library file what actual target library version. gcc -lNAME will seek for libNAME.so link or file then capture its SONAME that will certainly be more specific ( ex libnuke.so links to libnuke.so.0.1.4 that contains SONAME libnuke.so.0 ).

    At run time it will link with this is then set into ELF dynamic section NEEDED, then a library with this name ( or a link to it ) should exists.
    At Run time SONAME is disregarded, so only the link or the file existence is enough.

    Remark: SONAME is enforced only at link/build time and not at run time.

    ‘SONAME’ of library can be seen with ‘objdump -p file |grep SONAME’.
    ‘NEEDED’ of binaries can be seen with ‘objdump -p file |grep NEEDED’.

    [EDIT] WARNING Following is a general remark, not the one deployed in linux. See at the end.

    Let’s assume you have a library with libnuke.so.1.2 name and you develop a new libnuke library :

    • if your new library is a fix from previous without api change, you should just keep same soname, increase the version of filename. ie file will be libnuke.so.1.2.1 but soname will still be libnuke.so.1.2.
    • if you have a new library that only added new function but didn’t break functionality and is still compatible with previous you would like to use same soname than previous plus a new suffix like .1. ie file and soname will be libnuke.so.1.2.1. Any program linked with libnuke.1.2 will still work with that one. New programs linked with libnuke.1.2.1 will only work with that one ( until new subversion come like libnuke.1.2.1.1 ).
    • if your new library is not compatible with any libnuke : libnuke.so.2
    • if your new library is compatible with bare old version : libnuke.so.1.3 [ ie still compatible with libnuke.so.1 ]

    [EDIT] to complete : linux case.

    In linux real life SONAME as a specific form :
    lib[NAME][API-VERSION].so.[major-version]
    major-version is only one integer value that increase at each major library change.
    API-VERSION is empty by default

    ex libnuke.so.0

    Then real filename include minor versions and subversions ex : libnuke.so.0.1.5

    I think that not providing a soname is a bad practice since renaming of file will change its behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I program using PhoneGap and learned that cross-platform apps really produces slow applications compared
This is a program that using merge sort - sorts a list of 1000
So, I have a program that I'd like to translate to Croatian... But I've
i have learned that a program is measured by it's complexity - i mean
I learned that one of the motivation for copy constructor using is to avoid
Now I have learned that cin.getline works like this. cin.getline(dest string, number of charecters
Much to my dismay, I just learned that there is no volume purchase program
I'm starting to make my first C program in awhile using GTK+. I've learned
I just learned about ngrep , a cool program that lets you easily sniff
When I first learned to program I learned to do so with an IDE,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.