# From: Olin Shivers <firstname.lastname@example.org>
# Date: Mon, 16 Jan 95 14:36:49 -0500
# The dlopen/dlsym functions to which Brent was referring are for when you
# link in the C code at runtime, which we don't actually do right now in
# scsh. We just statically link the OS support code in with the VM, which
# is lower-tech and easier to port. But the problem of translating C proc names
# to addresses at run-time remains the same.
Hmmm. That's not exactly correct. On my platform (and on other
platforms like Suns running Solaris) you can (and do under scsh) use
dlopen and dlsym for finding the address of symbols within the
executable (a.out), not just from dynamically linked shared objects.
>From the dlopen man page (notice the last sentence):
dlopen makes a shared object available to a running process.
dlopen returns to the process a handle which the process may
use on subsequent calls to dlsym and dlclose. This value
should not be interpreted in any way by the process. path-
name is the path name of the object to be opened; it may be
an absolute path or relative to the current directory. If
the value of pathname is 0, dlopen will make the symbols
contained in the original a.out, and all of the objects that
were loaded at program startup with the a.out, available