HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
d
dlmodinfo(3C) dlmodinfo(3C)
(64-Bit Applications Only)
NAME
dlmodinfo - retrieve information about a loaded module (program or shared library)
SYNOPSIS
cc [flag ... ] file ... -ldl [library] ...
#include <dlfcn.h>
unsigned long dlmodinfo(unsigned long ip_value,
struct load_module_desc *desc,
size_t desc_size,
void *(*read_tgt_mem)(void* buffer,
unsigned long ptr,
size_t bufsiz,
int ident),
int ident_parm,
uint64_t load_map_parm);
DESCRIPTION
dlmodinfo is one of a family of routines that give the user direct access to the dynamic linking facilities.
dlmodinfo retrieves information about a loaded module from a given address value.
dlmodinfo()
searches all currently loaded load modules looking for a load module whose address range (address range of
all loaded segments) holds the given address value. The dlmodinfo routine fills the load_module_desc
with information from the matching load module.
ip_value is the instruction pointer value of the requested library. If the value is NULL, then desc will con-
tain the module info of dld itself. desc is a buffer of memory allocated by the user program. The dynamic
loader will fill this in with module information. desc_size is the size in bytes of the desc buffer.
read_tgt_mem is a pointer to a function used by
dlmodinfo to retrieve needed information. If the value
is NULL, the dynamic loader will use its own internal data structures to find the correct load module and
the following two parameters are ignored.
ident_parm Is only used to pass the fourth parameter to read_tgt_mem.
load_map_parm
Is only used when calling through read_tgt_mem. It contains the starting address of the
load map.
Otherwise, the function pointer will be used to read memory during its search, using these parameters:
buffer a buffer supplied by dlmodinfo to read into
ptr the virtual memory address to read from
bufsiz the size of buffer in bytes
ident the value of the ident_parm parameter to dlmodinfo
On success, read_tgt_mem will return the value of its buffer parameter, otherwise, it will return NULL.
read_tgt_mem allows dlmodinfo to find a load module in one process on behalf of another. The calling
process passes a callback via read_tgt_mem in order to read memory in a different process address space
from the one in which dlmodinfo resides. ip_value, load_map_parm, and ptr from read_tgt_mem can be
pointers to objects in another process. For example, when a 32 bit program wants to enquire about a 64 bit
program, the ip_value and load_map_parm should be 64 bit values. Any 32 bit pointers should be type-
casted to 64 bits by the user program when passed in the ip_value or load_map_parm parameters.
If the calling process calls
dlmodinfo with a callback registered via read_tgt_mem, it must supply the
starting address of the target process load map in the load_map_parm parameter to dlmodinfo. This
can be retrieved by using the
DT_HP_LOAD_MAP dynamic table entry in the target program file.
A cross-process load module operation can be done via dlmodinfo, for example, by issuing a call to
ttrace().
RETURN VALUE
If successful, dlmodinfo returns a handle for the shared library as defined by the return value from
dlopen(). NULL is returned otherwise. The return values are type-converted to unsigned long.
HP-UX Release 11i: December 2000 1 Section 3153
___
___