This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Can gcc and Linux create a dynamic library?
- From: ali hagigat <hagigatali at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 22 Dec 2010 07:35:42 -0800
- Subject: Can gcc and Linux create a dynamic library?
My question is about dynamic libraries and shared libraries in Linux
and their differences.
Is it possible to create a dynamic library by gcc?
Is my following understanding from a dynamic library OK?
I think a dynamic library is added to the address space of a running
code in run time.
If program A uses a dynamic library and in run time A references a
variable(not inside the code of A), then the code of that library is
added to the address space of A.
If another program B has been linked with the same library dynamically
and B references a variable (not inside the code of B), then the code
of that library is added to the address space of B too.
This concept is different with a shared library which its code is put
into the memory only once and many programs use it. Is that right?