From: David Wuertele <dave-gnus@bfnet.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Why does linking a.so with b.so require execs to be linked both -la and -lb?
Date: Tue, 12 Aug 2003 09:42:28 -0700 [thread overview]
Message-ID: <m3r83qzv2j.fsf@bfnet.com> (raw)
In-Reply-To: 16184.61520.502240.104624@cerise.nosuchdomain.co.uk
Thanks Glynn, for the excellent explanation!
Glynn> So, what you are asking is why Linux requires the indirect
Glynn> dependencies to be present at link time, right?
Exactly.
Glynn> One consequence of this difference is that Linux allows an
Glynn> executable to export symbols to a library. Thus you can create
Glynn> a library with unresolved references (i.e. symbols not provided
Glynn> by either the library or any of it's explicit dependencies). So
Glynn> long as that symbol actually gets provided at run-time (e.g. by
Glynn> the executable itself), everything works.
Does this "flexibility" have practical applications?
Glynn> In any case: if you need libB.so to actually run the
Glynn> executable, why does it matter if you need it in order to link
Glynn> the program?
Encapsulation and portability. We're writing a toolkit that isolates
the programmer from the underlying implementation. Requiring the
programmer to explicitly link to the underlying library requires that
the programmer know what that underlying library is. Also, it
prevents us from changing the underlying library. These goals don't
seem that unreasonable to us, and they are very important for our
application.
Dave
next prev parent reply other threads:[~2003-08-12 16:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-11 21:02 Why does linking a.so with b.so require execs to be linked both -la and -lb? David Wuertele
2003-08-11 23:50 ` Mike Castle
2003-08-12 0:10 ` David Wuertele
2003-08-12 13:49 ` Glynn Clements
2003-08-12 16:42 ` David Wuertele [this message]
2003-08-12 17:54 ` Glynn Clements
2003-08-12 19:12 ` Steven
2003-08-12 0:11 ` David Wuertele
2003-08-12 13:16 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r83qzv2j.fsf@bfnet.com \
--to=dave-gnus@bfnet.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).