Date: Fri, 31 Mar 2000 23:29:46 +0300
   From: Paul Sokolovsky <[EMAIL PROTECTED]>

                Shared                          DLLs

   Building:    require special support         doesn't require special support
                (namely, building with PIC)     (are built from the same
                                                set of objects as static would)

   Using:       doesn't require special         require special support
                support                         (namely, marking data as
                                                dllimported)

No.  As Gary said, ELF shared libraries can be built without special
support.  Building with PIC just makes the shared library more
efficient.  Also as Gary said, you can not put the same PE object into
both a DLL and a static library and expect it to work correctly; DLLs
require special techniques to load data members.

I've assumed that your ``Shared'' column refers to ELF.  There are
several different shared library implementations; the ones that come
to mind are:

* COFF, as used on SVR3.
* SunOS and ELF--ELF shared libraries were derived from SunOS.
* AIX--unique in this as in all other things.
* The old Linux a.out shared libraries.
* Digital Unix--reasonably similar to ELF, but using ECOFF.
* Windows DLLs--actually pretty similar to SVR3 shared libraries.

There is a very significant difference between ELF shared libraries
and Windows DLLs which you haven't explicitly mentioned.  In ELF, a
symbol defined in the main program overrides a symbol defined in a
shared library.  For example, if you define malloc in the main
program, then even if a shared library defines malloc itself, code in
the shared library which calls malloc will actually call the version
in the main program, not the version in the shared library.

Ian

Reply via email to