What is the difference between *.a and *.so files. I know that *.so is a shared library file and *.a is a tar'ed version(Am i not correct??..Please clarify) What advantage one get if we use *.a file instead of *.so file.? Where can i get more details about this?
Thanks Uday
Didn't find your answer? Ask the community — no account required.
R
Rainer Lehrig
.so files are shared object libraries (dynamic linking) .a files are static librarries
The advantage of .so files is, that they can be used by many applications. The advantage of .a files is, that everything is linked into your application. Thus you have no external dependencies.
R
Robert Kaiser
True.
A potential disadvantage of .so files that is sometimes relevant for low resource (e.g. embedded) systems is that they need to provide all bells and whistles that any conceivable user of the library might ever require. So, for example, glibc, which just about any program needs, has grown quite big and only a very small fraction of user programs (if any) actually uses all the functionality contained.
If you look at the the *combined* footprints of glibc and a hello-world-style application, you may end up using considerably less resources with a statically linked program. Of course, this advantage vanishes as soon as you need more than -say- 20 user programs, but for e.g. busybox-based embedded systems, static linking can result in significantly lower resource requirements.
Rob
Robert Kaiser email: rkaiser AT sysgo DOT com
SYSGO AG http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.com
M
Michael Schnell
Is there no tool that can trim down e.g. glibc for a given set of user programs, eliminating all parts that never are called ?
-Michael
R
Robert Kaiser
I seem to recall that there is (was?) such a tool, but I've certainly never seen it at work. Would be nice if someone who knows more could share his info with us.
Anyone ?
Rob
Robert Kaiser email: rkaiser AT sysgo DOT com
SYSGO AG http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.com
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.