Skip to content
Felix S. Klock II edited this page Jul 28, 2013 · 1 revision

Here are some notes on how different Operating Systems behave with respect to osdep_dlopen and osdep_dlsym.

PnkFelix is curious about getting pointers to functions that are linked into the executable. For example, just grabbing malloc or free, which is easy on Linux and Mac OS X, but may be harder on Solaris and Win32.

Back in 10/23/06, Jesse and PnkFelix did some experiments on this (changeset:3694).

  • Felix's notes from that time period indicate that Solaris does not support dlsym(0, ---), but Solaris can express what we want via dlopen( 0, LDFLAGS ) which returns an appropriate handle.
    • (That is, Solaris[[ dlsym(dlopen(0, LDFLAGS), ---) ]] = Linux[[ dlsym(0, ---) ]])

On Win32, there is call GetModuleHandle(NULL) that retrieves a reference to the current module, which may be passed to GetProcAddress.

Clone this wiki locally