RFC: libverto nearing release
nico at cryptonector.com
Thu Jul 7 11:04:34 EDT 2011
On Wed, Jul 6, 2011 at 6:26 PM, Nathaniel McCallum
<npmccallum at redhat.com> wrote:
> 3. It is not dlsym() I'm worried about, but dladdr(). I'm honestly not
> sure if there is a win32 equivalent for this. libverto uses dladdr() for
> two purposes. The first is to get the file name of the libverto library.
> I'm extremely confident we can do this in win32. The second is to test a
> signal handler on win32 to determine if it is in unmapped space. I have
> no idea what we will do here on win32, but we might be able to do
> something similar.
The first use of dladdr() is so you can format a path of a shared
object to load for a specific libverto module. I think there are
various ways of handling this instead of depending on dladdr(). For
example, if the caller gave you the path to libverto they used to
dlopen() it, you're done. Or if libverto is linked in instead of
dlopen()ed, then you'd open the modules by relative path and let the
system find them using whatever search path is in force.
The second use of dladdr() is completely superfluous: you're checking
for invalid signal handlers after dlclose()ing a module. There's
three options for that: a) require that modules clean up signal
handlers in .fini, b) tear down all event handling for that module
such that there ought to be no signal handlers left, then dlclose()
it, c), don't dlclose() the modules.
More information about the krbdev