linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shriramana Sharma <samjnaa@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: unable to link to a static library present alongside a shared library
Date: Thu, 19 Apr 2007 00:10:04 +0530	[thread overview]
Message-ID: <46266604.8090103@gmail.com> (raw)
In-Reply-To: <17958.13648.425008.752038@cerise.gclements.plus.com>

Please take some time to read the following as I have been reading some 
Wikipedia articles about libraries and have a few questions. You don't 
have to answer the entire mail at once but please don't ignore it 
because it's a bit long. You are my teachers here since I am neither 
neither a professional programmer nor do I have a computer science 
degree so I am trusting in you...

Glynn Clements wrote:

> But for a shared library, the end result will be a library which
> cannot actually be shared: effectively just a DLL (dynamically-linked
> library) rather than a *shared* library.

I thought dll : Windows :: so : *nix. Apparently it is not so. After 
reading your mail I read through the 
http://en.wikipedia.org/wiki/Library_(computing) article and learnt some 
things but I'm still not fully clear:

1)

A Windows DLL is a dynamic link library. I hope I am right in 
understanding that to "link" means to basically resolve external 
references in an object module. 
http://en.wikipedia.org/wiki/Position_independent_code#Windows_DLLs 
tells me that Windows DLLs would largely be shareable only on disk and 
not on memory were it not for the fact that they are premapped to 
certain addresses in memory.

But Unix SO files are truly shareable on memory since they use PIC.

Is that all the functional difference between Windows DLL-s and Unix SO-s?

2)

Is there a difference between a dynamic link library and a dynamic load 
library? Would I be right in understanding that a dynamic link lib needs 
to be loaded at the same time as (or previous to) the loading of the 
caller, but a dynamic load lib can be loaded *after* the loading of the 
caller? This might mean that the latter would be valid for functions. Is 
my understanding correct?

3)

Is there a conflict between 
http://en.wikipedia.org/wiki/Library_(computing)#Dynamic_linking and 
http://en.wikipedia.org/wiki/Linker#Dynamic_linking . They have 
different explanations of dynamic linking...

4)

Anyway, the first article has the phrase "index names or numbers" but it 
does not say names or numbers of what. (If you tell me I will edit the 
article myself.)

5)

The article http://en.wikipedia.org/wiki/Static_Library further confuses 
me. It says that a static lib is a lib *in which* references to external 
variables/functions are resolved at compile time. I thought it was a lib 
which *satisfies* the references present *in a caller* and where the 
linking is done at compile time. Should the wording be corrected?

6)

The article also says "... or at runtime by the linker or linking 
loader". I think the word "respectively" should be added after "loader", 
but still I don't understand how refs to symbols provided by a static 
lib can be resolved at runtime. To me it goes against the very nature of 
  a static lib. What am I missing?

> Also, on SELinux systems, you typically need to modify the security
> policy to allow such libraries to be used, 

Such libraries meaning?

Thanks, as always.

Shriramana.

  reply	other threads:[~2007-04-18 18:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-18 12:09 unable to link to a static library present alongside a shared library Shriramana Sharma
2007-04-18 12:19 ` cyon.john
2007-04-18 12:33   ` Shriramana Sharma
2007-04-18 14:00     ` cyon.john
2007-04-18 17:34       ` Shriramana Sharma
2007-04-18 15:12 ` Glynn Clements
2007-04-18 18:40   ` Shriramana Sharma [this message]
2007-04-18 20:18     ` Glynn Clements
2007-04-19 10:10       ` Shriramana Sharma
2007-04-19 12:34         ` leslie.polzer
2007-04-19 13:48           ` Shriramana Sharma
2007-04-19 16:30             ` leslie.polzer

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=46266604.8090103@gmail.com \
    --to=samjnaa@gmail.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).