* Ralf Wildenhues wrote on Sun, Jan 24, 2010 at 10:36:54AM CET:
> * Peter Rosin wrote on Fri, Jan 22, 2010 at 10:12:11AM CET:
> > As mentioned in another mail, should not lt_dlloader_add
> > call vtable->dlloader_init? That seems appropriate when
> > lt_dlloader_remove calls vtable->dlloade_exit...
> >
> > Like this (completely untested), just showing what I mean...
>
> Yes, I think this is an improvement. It is an API change
> however. I think we can argue that it is a compatible change,
> since .dlloader_init was undocumented before, and calling it
> a second time needs to be a no-op (we need to fix preopen.c!).
Argl. Wrong. The documentation contains:
/* User modules are responsible for their own initialisation. */
if (myloader_init () != 0)
return MYLOADER_INIT_ERROR;
[...]
Note that if there is any initialisation required for the loader, it
must be performed manually before the loader is registered - libltdl
doesn't handle user loader initialisation.
so we cannot easily change that. :-/
Invoking the .dlloader_init pointer invokes undefined behavior for
existing code which doesn't initialize this member. So this would be an
incompatible API change. I don't think it is worth breaking the API for
this.
Cheers,
Ralf