1 PADDR_TO_LOADOBJ(3PROC)                      Process Control Library Functions
   2 
   3 NAME
   4      Paddr_to_loadobj, Plmid_to_loadobj, Pname_to_loadobj - lookup loaded
   5      object information
   6 
   7 LIBRARY
   8      Process Control Library (libproc, -lproc)
   9 
  10 SYNOPSIS
  11      #include <libproc.h>
  12 
  13      const rd_loadobj_t *
  14      Paddr_to_loadobj(struct ps_prochandle *P, uintptr_t addr);
  15 
  16      const rd_loadobj_t *
  17      Plmid_to_loadobj(struct ps_prochandle *P, Lmid_t lmid, const char *name);
  18 
  19      const rd_loadobj_t *
  20      Pname_to_loadobj(struct ps_prochandle *P, const char *name);
  21 
  22 DESCRIPTION
  23      The Paddr_to_loadobj(), Plmid_to_loadobj(), and Pname_to_loadobj()
  24      functions lookup loaded object information from the process handle P.
  25      This information is provided by the run-time link-editor, ld.so.1(1), and
  26      provides information about the loaded object such as the link-map
  27      identifier, the TLS module ID, and the address of various sections.
  28 
  29      The pointer to the data returned by the library will only be valid for as
  30      long as the handle P is valid.  Any calls to Prelease(3PROC) will
  31      invalidate the data.
  32 
  33      The Paddr_to_loadobj() function attempts to find the loaded object
  34      information, if any, that exists for the address addr.  Not all address
  35      correspond to memory regions that were loaded by the run-time link-
  36      editor.  For example, if a user creates a region of anonymous memory
  37      through the mmap(2) function, then it will not have any corresponding
  38      loaded module.
  39 
  40      The Pname_to_loadobj() function looks up the object named name and
  41      returns the corresponding loaded object information.  Two special values
  42      may be used for name.  The macro PR_OBJ_EXEC refers to the executable
  43      object itself and the macro PR_OBJ_LDSO refers to the object ld.so.1.
  44 
  45      The Plmid_to_loadobj() function is similar to Pname_to_loadobj().  It
  46      allows the use of a link-map identifier, lmid, which constricts the
  47      search of the object named with name to that link-map.  The special value
  48      of PR_LMID_EVERY may be passed to indicate that every link-map should be
  49      searched, which is equivalent in behavior to the Pname_to_loadobj()
  50      function.
  51 
  52 RETURN VALUES
  53      Upon successful completion, the Paddr_to_loadobj(), Plmid_to_loadobj(),
  54      and Pname_to_loadobj() functions return a pointer to the corresponding
  55      loadable object information.  Otherwise, if none exists then NULL is
  56      returned.
  57 
  58 INTERFACE STABILITY
  59      Uncommitted
  60 
  61 MT-LEVEL
  62      See LOCKING in libproc(3LIB).
  63 
  64 SEE ALSO
  65      libproc(3LIB), librtld_db(3LIB), Prelease(3PROC)
  66 
  67 illumos                          May 11, 2016                          illumos