Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 1997 13:34:20 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        rssh@cki.ipri.kiev.ua
Cc:        gurney_j@resnet.uoregon.edu, freebsd-hackers@freebsd.org
Subject:   Re: Dynamic linking libraries [Q]
Message-ID:  <199704222034.NAA27003@phaeton.artisoft.com>
In-Reply-To: <335CD2F6.1429@cki.ipri.kiev.ua> from "Ruslan Shevchenko" at Apr 22, 97 06:02:10 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > > Are anybody thinking about implementation of stuff ?
> > > (not .so, simular to win DLL)
> > 
> > they already exist as shared libs... then if you want something more
> > like DLL... take a look at dlopen...  you can use that to load shared
> > libs into memory and make calls into the library...
> > 
> 
> Problem: I can't share *one* copy of shared library 
> by different programs 

This is false.  There is only one instance of the vnode in vore, and
there is only one list of page buffers hung off the vnode representing
the in disk file data contained in the shared object.

What *is* different is:

1)	User processes operate in seperate address spaces; the pages
	associated with the vnode are mapped into each processes
	address space.  This is no different from how Win95 handles
	DLL's.

2)	The static data in the shared object is statically linked into
	the process image instead of being instantiated each time.  The
	reasons for this are:

	A)	The MS vtable is slightly different from the less
		correct GCC vtable implementation.  FreeBSD does not
		do fixups (this means the FreeBSD vtable is shared
		between processes and the MS vtable is not).

	B)	There is no section attribution available in a.out
		shared object format, so the section information can
		not be used to distinguish global data.

	C)	UNIX (and clone) system processes can not share address
		space in this way; MS uses user space mappings, which
		violate the protection between processes interfering
		with each other.

	Effectively, this is the same as if you had placed the data
	in the "LIB" proxy stub instead of the DLL under MS.

So most of what you want is already there.  The data stuff is desirable,
if only to get around the LGPL "included code" (virtual base classes)
and "relink" (data and code associated with a library not part of the
image) clauses, but is not necessary... you can either write dataless
functions, or create the data via constructor (assuming C++) or via
ctor/dtor linker sets (assuming C or some other language).


					Regards,
					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704222034.NAA27003>