850 lines
23 KiB
HTML
850 lines
23 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of RTLD-AUDIT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>RTLD-AUDIT</H1>
|
|
Section: Linux Programmer's Manual (7)<BR>Updated: 2019-03-06<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
rtld-audit - auditing API for the dynamic linker
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>#define _GNU_SOURCE</B> /* See <A HREF="/cgi-bin/man/man2html?7+feature_test_macros">feature_test_macros</A>(7) */
|
|
<B>#include <<A HREF="file:///usr/include/link.h">link.h</A>></B>
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The GNU dynamic linker (run-time linker)
|
|
provides an auditing API that allows an application
|
|
to be notified when various dynamic linking events occur.
|
|
This API is very similar to the auditing interface provided by the
|
|
Solaris run-time linker.
|
|
The necessary constants and prototypes are defined by including
|
|
<I><<A HREF="file:///usr/include/link.h">link.h</A>></I>.
|
|
|
|
<P>
|
|
|
|
To use this interface, the programmer creates a shared library
|
|
that implements a standard set of function names.
|
|
Not all of the functions need to be implemented: in most cases,
|
|
if the programmer is not interested in a particular class of auditing event,
|
|
then no implementation needs to be provided for the corresponding
|
|
auditing function.
|
|
<P>
|
|
|
|
To employ the auditing interface, the environment variable
|
|
<B>LD_AUDIT</B>
|
|
|
|
must be defined to contain a colon-separated list of shared libraries,
|
|
each of which can implement (parts of) the auditing API.
|
|
When an auditable event occurs,
|
|
the corresponding function is invoked in each library,
|
|
in the order that the libraries are listed.
|
|
<A NAME="lbAE"> </A>
|
|
<H3>la_version()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>unsigned int la_version(unsigned int </B><I>version</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
This is the only function that
|
|
<I>must</I>
|
|
|
|
be defined by an auditing library:
|
|
it performs the initial handshake between the dynamic linker and
|
|
the auditing library.
|
|
When invoking this function, the dynamic linker passes, in
|
|
<I>version</I>,
|
|
|
|
the highest version of the auditing interface that the linker supports.
|
|
If necessary, the auditing library can check that this version
|
|
is sufficient for its requirements.
|
|
<P>
|
|
|
|
As its function result,
|
|
this function should return the version of the auditing interface
|
|
that this auditing library expects to use (returning
|
|
<I>version</I>
|
|
|
|
is acceptable).
|
|
If the returned value is 0,
|
|
or a version that is greater than that supported by the dynamic linker,
|
|
then the audit library is ignored.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>la_objsearch()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>char *la_objsearch(const char *</B><I>name</I><B>, uintptr_t *</B><I>cookie</I><B>,</B>
|
|
<B> unsigned int </B><I>flag</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The dynamic linker invokes this function to inform the auditing library
|
|
that it is about to search for a shared object.
|
|
The
|
|
<I>name</I>
|
|
|
|
argument is the filename or pathname that is to be searched for.
|
|
<I>cookie</I>
|
|
|
|
identifies the shared object that initiated the search.
|
|
<I>flag</I>
|
|
|
|
is set to one of the following values:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>LA_SER_ORIG</B>
|
|
|
|
<DD>
|
|
This is the original name that is being searched for.
|
|
Typically, this name comes from an ELF
|
|
<B>DT_NEEDED</B>
|
|
|
|
entry, or is the
|
|
<I>filename</I>
|
|
|
|
argument given to
|
|
<B><A HREF="/cgi-bin/man/man2html?3+dlopen">dlopen</A></B>(3).
|
|
|
|
<DT id="2"><B>LA_SER_LIBPATH</B>
|
|
|
|
<DD>
|
|
<I>name</I>
|
|
|
|
was created using a directory specified in
|
|
<B>LD_LIBRARY_PATH</B>.
|
|
|
|
<DT id="3"><B>LA_SER_RUNPATH</B>
|
|
|
|
<DD>
|
|
<I>name</I>
|
|
|
|
was created using a directory specified in an ELF
|
|
<B>DT_RPATH</B>
|
|
|
|
or
|
|
<B>DT_RUNPATH</B>
|
|
|
|
list.
|
|
<DT id="4"><B>LA_SER_CONFIG</B>
|
|
|
|
<DD>
|
|
<I>name</I>
|
|
|
|
was found via the
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ldconfig">ldconfig</A></B>(8)
|
|
|
|
cache
|
|
(<I>/etc/ld.so.cache</I>).
|
|
|
|
<DT id="5"><B>LA_SER_DEFAULT</B>
|
|
|
|
<DD>
|
|
<I>name</I>
|
|
|
|
was found via a search of one of the default directories.
|
|
<DT id="6"><B>LA_SER_SECURE</B>
|
|
|
|
<DD>
|
|
<I>name</I>
|
|
|
|
is specific to a secure object (unused on Linux).
|
|
</DL>
|
|
<P>
|
|
|
|
As its function result,
|
|
<B>la_objsearch</B>()
|
|
|
|
returns the pathname that the dynamic linker should use
|
|
for further processing.
|
|
If NULL is returned, then this pathname is ignored for further processing.
|
|
If this audit library simply intends to monitor search paths, then
|
|
<I>name</I>
|
|
|
|
should be returned.
|
|
<A NAME="lbAG"> </A>
|
|
<H3>la_activity()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>void la_activity( uintptr_t *</B><I>cookie</I><B>, unsigned int flag</B><I>);</I>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The dynamic linker calls this function to inform the auditing library
|
|
that link-map activity is occurring.
|
|
<I>cookie</I>
|
|
|
|
identifies the object at the head of the link map.
|
|
When the dynamic linker invokes this function,
|
|
<I>flag</I>
|
|
|
|
is set to one of the following values:
|
|
<DL COMPACT>
|
|
<DT id="7"><B>LA_ACT_ADD</B>
|
|
|
|
<DD>
|
|
New objects are being added to the link map.
|
|
<DT id="8"><B>LA_ACT_DELETE</B>
|
|
|
|
<DD>
|
|
Objects are being removed from the link map.
|
|
<DT id="9"><B>LA_ACT_CONSISTENT</B>
|
|
|
|
<DD>
|
|
Link-map activity has been completed: the map is once again consistent.
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H3>la_objopen()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>unsigned int la_objopen(struct link_map *</B><I>map</I><B>, Lmid_t </B><I>lmid</I><B>,</B>
|
|
<B> uintptr_t *</B><I>cookie</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The dynamic linker calls this function when a new shared object is loaded.
|
|
The
|
|
<I>map</I>
|
|
|
|
argument is a pointer to a link-map structure that describes the object.
|
|
The
|
|
<I>lmid</I>
|
|
|
|
field has one of the following values
|
|
<DL COMPACT>
|
|
<DT id="10"><B>LM_ID_BASE</B>
|
|
|
|
<DD>
|
|
Link map is part of the initial namespace.
|
|
<DT id="11"><B>LM_ID_NEWLM</B>
|
|
|
|
<DD>
|
|
Link map is part of a new namespace requested via
|
|
<B><A HREF="/cgi-bin/man/man2html?3+dlmopen">dlmopen</A></B>(3).
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
<I>cookie</I>
|
|
|
|
is a pointer to an identifier for this object.
|
|
The identifier is provided to later calls to functions
|
|
in the auditing library in order to identify this object.
|
|
This identifier is initialized to point to object's link map,
|
|
but the audit library can change the identifier to some other value
|
|
that it may prefer to use to identify the object.
|
|
<P>
|
|
|
|
As its return value,
|
|
<B>la_objopen</B>()
|
|
|
|
returns a bit mask created by ORing zero or more of the
|
|
following constants,
|
|
which allow the auditing library to select the objects to be monitored by
|
|
<B>la_symbind*</B>():
|
|
|
|
<DL COMPACT>
|
|
<DT id="12"><B>LA_FLG_BINDTO</B>
|
|
|
|
<DD>
|
|
Audit symbol bindings to this object.
|
|
<DT id="13"><B>LA_FLG_BINDFROM</B>
|
|
|
|
<DD>
|
|
Audit symbol bindings from this object.
|
|
</DL>
|
|
<P>
|
|
|
|
A return value of 0 from
|
|
<B>la_objopen</B>()
|
|
|
|
indicates that no symbol bindings should be audited for this object.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>la_objclose()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>unsigned int la_objclose(uintptr_t *</B><I>cookie</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The dynamic linker invokes this function after any finalization
|
|
code for the object has been executed,
|
|
before the object is unloaded.
|
|
The
|
|
<I>cookie</I>
|
|
|
|
argument is the identifier obtained from a previous invocation of
|
|
<B>la_objopen</B>().
|
|
|
|
<P>
|
|
|
|
In the current implementation, the value returned by
|
|
<B>la_objclose</B>()
|
|
|
|
is ignored.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>la_preinit()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>void la_preinit(uintptr_t *</B><I>cookie</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The dynamic linker invokes this function after all shared objects
|
|
have been loaded, before control is passed to the application
|
|
(i.e., before calling
|
|
<I>main</I>()).
|
|
|
|
Note that
|
|
<I>main</I>()
|
|
|
|
may still later dynamically load objects using
|
|
<B><A HREF="/cgi-bin/man/man2html?3+dlopen">dlopen</A></B>(3).
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H3>la_symbind*()</H3>
|
|
|
|
|
|
<PRE>
|
|
<B>uintptr_t la_symbind32(Elf32_Sym *</B><I>sym</I><B>, unsigned int </B><I>ndx</I><B>,</B>
|
|
<B> uintptr_t *</B><I>refcook</I><B>, uintptr_t *</B><I>defcook</I><B>,</B>
|
|
<B> unsigned int *</B><I>flags</I><B>, const char *</B><I>symname</I><B>);</B>
|
|
<B>uintptr_t la_symbind64(Elf64_Sym *</B><I>sym</I><B>, unsigned int </B><I>ndx</I><B>,</B>
|
|
<B> uintptr_t *</B><I>refcook</I><B>, uintptr_t *</B><I>defcook</I><B>,</B>
|
|
<B> unsigned int *</B><I>flags</I><B>, const char *</B><I>symname</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
The dynamic linker invokes one of these functions
|
|
when a symbol binding occurs between two shared objects
|
|
that have been marked for auditing notification by
|
|
<B>la_objopen</B>().
|
|
|
|
The
|
|
<B>la_symbind32</B>()
|
|
|
|
function is employed on 32-bit platforms;
|
|
the
|
|
<B>la_symbind64</B>()
|
|
|
|
function is employed on 64-bit platforms.
|
|
<P>
|
|
|
|
The
|
|
<I>sym</I>
|
|
|
|
argument is a pointer to a structure
|
|
that provides information about the symbol being bound.
|
|
The structure definition is shown in
|
|
<I><<A HREF="file:///usr/include/elf.h">elf.h</A>></I>.
|
|
|
|
Among the fields of this structure,
|
|
<I>st_value</I>
|
|
|
|
indicates the address to which the symbol is bound.
|
|
<P>
|
|
|
|
The
|
|
<I>ndx</I>
|
|
|
|
argument gives the index of the symbol in the symbol table
|
|
of the bound shared object.
|
|
<P>
|
|
|
|
The
|
|
<I>refcook</I>
|
|
|
|
argument identifies the shared object that is making the symbol reference;
|
|
this is the same identifier that is provided to the
|
|
<B>la_objopen</B>()
|
|
|
|
function that returned
|
|
<B>LA_FLG_BINDFROM</B>.
|
|
|
|
The
|
|
<I>defcook</I>
|
|
|
|
argument identifies the shared object that defines the referenced symbol;
|
|
this is the same identifier that is provided to the
|
|
<B>la_objopen</B>()
|
|
|
|
function that returned
|
|
<B>LA_FLG_BINDTO</B>.
|
|
|
|
<P>
|
|
|
|
The
|
|
<I>symname</I>
|
|
|
|
argument points a string containing the name of the symbol.
|
|
<P>
|
|
|
|
The
|
|
<I>flags</I>
|
|
|
|
argument is a bit mask that both provides information about the symbol
|
|
and can be used to modify further auditing of this
|
|
PLT (Procedure Linkage Table) entry.
|
|
The dynamic linker may supply the following bit values in this argument:
|
|
|
|
<DL COMPACT>
|
|
<DT id="14"><B>LA_SYMB_DLSYM</B>
|
|
|
|
<DD>
|
|
The binding resulted from a call to
|
|
<B><A HREF="/cgi-bin/man/man2html?3+dlsym">dlsym</A></B>(3).
|
|
|
|
<DT id="15"><B>LA_SYMB_ALTVALUE</B>
|
|
|
|
<DD>
|
|
A previous
|
|
<B>la_symbind*</B>()
|
|
|
|
call returned an alternate value for this symbol.
|
|
</DL>
|
|
<P>
|
|
|
|
By default, if the auditing library implements
|
|
<B>la_pltenter</B>()
|
|
|
|
and
|
|
<B>la_pltexit</B>()
|
|
|
|
functions (see below), then these functions are invoked, after
|
|
<B>la_symbind</B>(),
|
|
|
|
for PLT entries, each time the symbol is referenced.
|
|
|
|
|
|
|
|
The following flags can be ORed into
|
|
<I>*flags</I>
|
|
|
|
to change this default behavior:
|
|
<DL COMPACT>
|
|
<DT id="16"><B>LA_SYMB_NOPLTENTER</B>
|
|
|
|
<DD>
|
|
Don't call
|
|
<B>la_pltenter</B>()
|
|
|
|
for this symbol.
|
|
<DT id="17"><B>LA_SYMB_NOPLTEXIT</B>
|
|
|
|
<DD>
|
|
Don't call
|
|
<B>la_pltexit</B>()
|
|
|
|
for this symbol.
|
|
</DL>
|
|
<P>
|
|
|
|
The return value of
|
|
<B>la_symbind32</B>()
|
|
|
|
and
|
|
<B>la_symbind64</B>()
|
|
|
|
is the address to which control should be passed after the function returns.
|
|
If the auditing library is simply monitoring symbol bindings,
|
|
then it should return
|
|
<I>sym->st_value</I>.
|
|
|
|
A different value may be returned if the library wishes to direct control
|
|
to an alternate location.
|
|
<A NAME="lbAL"> </A>
|
|
<H3>la_pltenter()</H3>
|
|
|
|
The precise name and argument types for this function
|
|
depend on the hardware platform.
|
|
(The appropriate definition is supplied by
|
|
<I><<A HREF="file:///usr/include/link.h">link.h</A>></I>.)
|
|
|
|
Here is the definition for x86-32:
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Elf32_Addr la_i86_gnu_pltenter(Elf32_Sym *</B><I>sym</I><B>, unsigned int </B><I>ndx</I><B>,</B>
|
|
<B> uintptr_t *</B><I>refcook</I><B>, uintptr_t *</B><I>defcook</I><B>,</B>
|
|
<B> La_i86_regs *</B><I>regs</I><B>, unsigned int *</B><I>flags</I><B>,</B>
|
|
<B> const char *</B><I>symname</I><B>, long int *</B><I>framesizep</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
This function is invoked just before a PLT entry is called,
|
|
between two shared objects that have been marked for binding notification.
|
|
<P>
|
|
|
|
The
|
|
<I>sym</I>,
|
|
|
|
<I>ndx</I>,
|
|
|
|
<I>refcook</I>,
|
|
|
|
<I>defcook</I>,
|
|
|
|
and
|
|
<I>symname</I>
|
|
|
|
are as for
|
|
<B>la_symbind*</B>().
|
|
|
|
<P>
|
|
|
|
The
|
|
<I>regs</I>
|
|
|
|
argument points to a structure (defined in
|
|
<I><<A HREF="file:///usr/include/link.h">link.h</A>></I>)
|
|
|
|
containing the values of registers to be used for
|
|
the call to this PLT entry.
|
|
<P>
|
|
|
|
The
|
|
<I>flags</I>
|
|
|
|
argument points to a bit mask that conveys information about,
|
|
and can be used to modify subsequent auditing of, this PLT entry, as for
|
|
<B>la_symbind*</B>().
|
|
|
|
<P>
|
|
|
|
|
|
The
|
|
<I>framesizep</I>
|
|
|
|
argument points to a
|
|
<I>long int</I>
|
|
|
|
buffer that can be used to explicitly set the frame size
|
|
used for the call to this PLT entry.
|
|
If different
|
|
<B>la_pltenter</B>()
|
|
|
|
invocations for this symbol return different values,
|
|
then the maximum returned value is used.
|
|
The
|
|
<B>la_pltexit</B>()
|
|
|
|
function is called only if this buffer is
|
|
explicitly set to a suitable value.
|
|
<P>
|
|
|
|
The return value of
|
|
<B>la_pltenter</B>()
|
|
|
|
is as for
|
|
<B>la_symbind*</B>().
|
|
|
|
<A NAME="lbAM"> </A>
|
|
<H3>la_pltexit()</H3>
|
|
|
|
The precise name and argument types for this function
|
|
depend on the hardware platform.
|
|
(The appropriate definition is supplied by
|
|
<I><<A HREF="file:///usr/include/link.h">link.h</A>></I>.)
|
|
|
|
Here is the definition for x86-32:
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>unsigned int la_i86_gnu_pltexit(Elf32_Sym *</B><I>sym</I><B>, unsigned int </B><I>ndx</I><B>,</B>
|
|
<B> uintptr_t *</B><I>refcook</I><B>, uintptr_t *</B><I>defcook</I><B>,</B>
|
|
<B> const La_i86_regs *</B><I>inregs</I><B>, La_i86_retval *</B><I>outregs</I><B>,</B>
|
|
<B> const char *</B><I>symname</I><B>);</B>
|
|
</PRE>
|
|
|
|
<P>
|
|
|
|
This function is called when a PLT entry,
|
|
made between two shared objects that have been marked
|
|
for binding notification, returns.
|
|
The function is called just before control returns to the caller
|
|
of the PLT entry.
|
|
<P>
|
|
|
|
The
|
|
<I>sym</I>,
|
|
|
|
<I>ndx</I>,
|
|
|
|
<I>refcook</I>,
|
|
|
|
<I>defcook</I>,
|
|
|
|
and
|
|
<I>symname</I>
|
|
|
|
are as for
|
|
<B>la_symbind*</B>().
|
|
|
|
<P>
|
|
|
|
The
|
|
<I>inregs</I>
|
|
|
|
argument points to a structure (defined in
|
|
<I><<A HREF="file:///usr/include/link.h">link.h</A>></I>)
|
|
|
|
containing the values of registers used for the call to this PLT entry.
|
|
The
|
|
<I>outregs</I>
|
|
|
|
argument points to a structure (defined in
|
|
<I><<A HREF="file:///usr/include/link.h">link.h</A>></I>)
|
|
|
|
containing return values for the call to this PLT entry.
|
|
These values can be modified by the caller,
|
|
and the changes will be visible to the caller of the PLT entry.
|
|
<P>
|
|
|
|
In the current GNU implementation, the return value of
|
|
<B>la_pltexit</B>()
|
|
|
|
is ignored.
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAN"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
This API is nonstandard, but very similar to the Solaris API,
|
|
described in the Solaris
|
|
<I>Linker and Libraries Guide</I>,
|
|
|
|
in the chapter
|
|
<I>Runtime Linker Auditing Interface</I>.
|
|
|
|
<A NAME="lbAO"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
Note the following differences from the Solaris dynamic linker
|
|
auditing API:
|
|
<DL COMPACT>
|
|
<DT id="18">*<DD>
|
|
The Solaris
|
|
<B>la_objfilter</B>()
|
|
|
|
interface is not supported by the GNU implementation.
|
|
<DT id="19">*<DD>
|
|
The Solaris
|
|
<B>la_symbind32</B>()
|
|
|
|
and
|
|
<B>la_pltexit</B>()
|
|
|
|
functions do not provide a
|
|
<I>symname</I>
|
|
|
|
argument.
|
|
<DT id="20">*<DD>
|
|
The Solaris
|
|
<B>la_pltexit</B>()
|
|
|
|
function does not provide
|
|
<I>inregs</I>
|
|
|
|
and
|
|
<I>outregs</I>
|
|
|
|
arguments (but does provide a
|
|
<I>retval</I>
|
|
|
|
argument with the function return value).
|
|
</DL>
|
|
<A NAME="lbAP"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
In glibc versions up to and include 2.9,
|
|
specifying more than one audit library in
|
|
<B>LD_AUDIT</B>
|
|
|
|
results in a run-time crash.
|
|
This is reportedly fixed in glibc 2.10.
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAQ"> </A>
|
|
<H2>EXAMPLE</H2>
|
|
|
|
|
|
#include <<A HREF="file:///usr/include/link.h">link.h</A>>
|
|
#include <<A HREF="file:///usr/include/stdio.h">stdio.h</A>>
|
|
<P>
|
|
unsigned int
|
|
la_version(unsigned int version)
|
|
{
|
|
<BR> printf("la_version(): %d\n", version);
|
|
<P>
|
|
<BR> return version;
|
|
}
|
|
<P>
|
|
char *
|
|
la_objsearch(const char *name, uintptr_t *cookie, unsigned int flag)
|
|
{
|
|
<BR> printf("la_objsearch(): name = %s; cookie = %p", name, cookie);
|
|
<BR> printf("; flag = %s\n",
|
|
<BR> (flag == LA_SER_ORIG) ? "LA_SER_ORIG" :
|
|
<BR> (flag == LA_SER_LIBPATH) ? "LA_SER_LIBPATH" :
|
|
<BR> (flag == LA_SER_RUNPATH) ? "LA_SER_RUNPATH" :
|
|
<BR> (flag == LA_SER_DEFAULT) ? "LA_SER_DEFAULT" :
|
|
<BR> (flag == LA_SER_CONFIG) ? "LA_SER_CONFIG" :
|
|
<BR> (flag == LA_SER_SECURE) ? "LA_SER_SECURE" :
|
|
<BR> "???");
|
|
<P>
|
|
<BR> return name;
|
|
}
|
|
<P>
|
|
void
|
|
la_activity (uintptr_t *cookie, unsigned int flag)
|
|
{
|
|
<BR> printf("la_activity(): cookie = %p; flag = %s\n", cookie,
|
|
<BR> (flag == LA_ACT_CONSISTENT) ? "LA_ACT_CONSISTENT" :
|
|
<BR> (flag == LA_ACT_ADD) ? "LA_ACT_ADD" :
|
|
<BR> (flag == LA_ACT_DELETE) ? "LA_ACT_DELETE" :
|
|
<BR> "???");
|
|
}
|
|
<P>
|
|
unsigned int
|
|
la_objopen(struct link_map *map, Lmid_t lmid, uintptr_t *cookie)
|
|
{
|
|
<BR> printf("la_objopen(): loading \"%s\"; lmid = %s; cookie=%p\n",
|
|
<BR> map->l_name,
|
|
<BR> (lmid == LM_ID_BASE) ? "LM_ID_BASE" :
|
|
<BR> (lmid == LM_ID_NEWLM) ? "LM_ID_NEWLM" :
|
|
<BR> "???",
|
|
<BR> cookie);
|
|
<P>
|
|
<BR> return LA_FLG_BINDTO | LA_FLG_BINDFROM;
|
|
}
|
|
<P>
|
|
unsigned int
|
|
la_objclose (uintptr_t *cookie)
|
|
{
|
|
<BR> printf("la_objclose(): %p\n", cookie);
|
|
<P>
|
|
<BR> return 0;
|
|
}
|
|
<P>
|
|
void
|
|
la_preinit(uintptr_t *cookie)
|
|
{
|
|
<BR> printf("la_preinit(): %p\n", cookie);
|
|
}
|
|
<P>
|
|
uintptr_t
|
|
la_symbind32(Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
|
<BR> uintptr_t *defcook, unsigned int *flags, const char *symname)
|
|
{
|
|
<BR> printf("la_symbind32(): symname = %s; sym->st_value = %p\n",
|
|
<BR> symname, sym->st_value);
|
|
<BR> printf(" ndx = %d; flags = 0x%x", ndx, *flags);
|
|
<BR> printf("; refcook = %p; defcook = %p\n", refcook, defcook);
|
|
<P>
|
|
<BR> return sym->st_value;
|
|
}
|
|
<P>
|
|
uintptr_t
|
|
la_symbind64(Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
|
<BR> uintptr_t *defcook, unsigned int *flags, const char *symname)
|
|
{
|
|
<BR> printf("la_symbind64(): symname = %s; sym->st_value = %p\n",
|
|
<BR> symname, sym->st_value);
|
|
<BR> printf(" ndx = %d; flags = 0x%x", ndx, *flags);
|
|
<BR> printf("; refcook = %p; defcook = %p\n", refcook, defcook);
|
|
<P>
|
|
<BR> return sym->st_value;
|
|
}
|
|
<P>
|
|
Elf32_Addr
|
|
la_i86_gnu_pltenter(Elf32_Sym *sym, unsigned int ndx,
|
|
<BR> uintptr_t *refcook, uintptr_t *defcook, La_i86_regs *regs,
|
|
<BR> unsigned int *flags, const char *symname, long int *framesizep)
|
|
{
|
|
<BR> printf("la_i86_gnu_pltenter(): %s (%p)\n", symname, sym->st_value);
|
|
<P>
|
|
<BR> return sym->st_value;
|
|
}
|
|
|
|
<A NAME="lbAR"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ldd">ldd</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+dlopen">dlopen</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ld.so">ld.so</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ldconfig">ldconfig</A></B>(8)
|
|
|
|
<A NAME="lbAS"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="21"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="22"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="23"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="24"><A HREF="#lbAE">la_version()</A><DD>
|
|
<DT id="25"><A HREF="#lbAF">la_objsearch()</A><DD>
|
|
<DT id="26"><A HREF="#lbAG">la_activity()</A><DD>
|
|
<DT id="27"><A HREF="#lbAH">la_objopen()</A><DD>
|
|
<DT id="28"><A HREF="#lbAI">la_objclose()</A><DD>
|
|
<DT id="29"><A HREF="#lbAJ">la_preinit()</A><DD>
|
|
<DT id="30"><A HREF="#lbAK">la_symbind*()</A><DD>
|
|
<DT id="31"><A HREF="#lbAL">la_pltenter()</A><DD>
|
|
<DT id="32"><A HREF="#lbAM">la_pltexit()</A><DD>
|
|
</DL>
|
|
<DT id="33"><A HREF="#lbAN">CONFORMING TO</A><DD>
|
|
<DT id="34"><A HREF="#lbAO">NOTES</A><DD>
|
|
<DT id="35"><A HREF="#lbAP">BUGS</A><DD>
|
|
<DT id="36"><A HREF="#lbAQ">EXAMPLE</A><DD>
|
|
<DT id="37"><A HREF="#lbAR">SEE ALSO</A><DD>
|
|
<DT id="38"><A HREF="#lbAS">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:09 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|