dlsym: R Interface to dlsym routine to lookup Native Symbol

dlsymR Documentation

R Interface to dlsym routine to lookup Native Symbol

Description

This gets a pointer to a named routine by looking for it in either the R executable or a specified shared library (DSO/DLL). We added this so that we could access routines in the R executable which are not accessible via getNativeSymbolInfo as that does not perform dynamic lookup on the R executable, only on loaded DSO/DLLs. However, it turns out we don't actually need this as LLVM will implicitly find the external symbols we reference in a Module and will look in the host application's symbol table.

Usage

dlsym(id, dll = NULL)

Arguments

id

the name of the routine to find

dll

the DSO/DLL in which to search for the named routine. NULL means look in the host application, i.e., R, but could be different if R is embedded in an application. Alternatively, one can provide the name of a DSO/DLL or a previously loaded DSO/DLL of class DLLInfo created by, e.g., dyn.load.

Details

This calls the UNIX dlsym routine, along with dlopen and dlclose as necessary.

Value

An object of class NativeSymbol. This is a list with one element named address which contains an externalptr whose value is the memory address of the routine we are querying.

Author(s)

DTL

See Also

getNativeSymbolInfo

Examples

dlsym("Rf_protect")

duncantl/Rllvm documentation built on April 23, 2024, 6:14 p.m.