for review: extras/dynamic_linking

Bert Thompson aet at cs.mu.OZ.AU
Mon Dec 7 16:32:28 AEDT 1998


Fergus Henderson <fjh at cs.mu.OZ.AU> writes:


|I started writing an email explaining how to implement
|dynamic linking, but in the end it seemed that the best
|way of explaining it was to just go ahead and do it.

|So, could someone please review this?

Fergus,

A further possibility is to provide an interface to the Win32 dynamic
loading calls, and add a module that provides the same functionality
but abstracts away from the platform-specific implementations. Worth
seeing how Erlang does this?

You may've done this already, but it would be good to look at the
interfaces of dlsym etc on important Unixes such as Solaris and HP-UX.
They're pretty uniform these days, fortunately.

Yet another thing that would be nice is to store type-infos in some
standard format in the shobject and do load-time interface checking.
For instance, you could have a compiler switch --generate-type-info-
table that creates a pred of known type called "type_table", or some
such thing, in which the types of all the module's exports are stored.

Ensuring there are no dangling references when unloading would
be nice, but it is very difficult to do correctly.

Maybe some of this stuff could be `possible extensions' comments in the code?

Bert

|--------------------

|Estimated hours taken: 5

|extras/dynamic_linking/dl.m:
|	New module, containing support for dynamic linking
|	(i.e. a binding to dlopen(), dlsym(), and dlclose()).

|extras/dynamic_linking/name_mangle.m:
|	New module, containing a representation for Mercury procedure
|	specifiers and a function for mangling them into symbol names.




More information about the developers mailing list