{"id":4082,"date":"2022-12-20T17:39:20","date_gmt":"2022-12-20T20:39:20","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/rtld-audit-man7\/"},"modified":"2022-12-20T17:39:20","modified_gmt":"2022-12-20T20:39:20","slug":"rtld-audit-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/rtld-audit-man7\/","title":{"rendered":"RTLD-AUDIT (man7)"},"content":{"rendered":"<h1 align=\"center\">RTLD-AUDIT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">rtld-audit \u2212 auditing API for the dynamic linker<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#define _GNU_SOURCE<\/b> \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var See feature_test_macros(7) bodies\/ usr\/ <b><br \/> #include <link.h><\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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><link.h><\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_version() <br \/> unsigned int la_version(unsigned int<\/b> <i>version<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A typical implementation of this function simply returns the constant <b>LAV_CURRENT<\/b>, which indicates the version of <i><link.h><\/i> that was used to build the audit module. If the dynamic linker does not support this version of the audit interface, it will refuse to activate this audit module. If the function returns zero, the dynamic linker also does not activate this audit module.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In order to enable backwards compatibility with older dynamic linkers, an audit module can examine the <i>version<\/i> argument and return an earlier version than <b>LAV_CURRENT<\/b>, assuming the module can adjust its implementation to match the requirements of the previous version of the audit interface. The <b>la_version<\/b> function should not return the value of <i>version<\/i> without further checks because it could correspond to an interface that does not match the <i><link.h><\/i> definitions used to build the audit module.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_objsearch() <br \/> char *la_objsearch(const char *<\/b><i>name<\/i><b>, uintptr_t *<\/b><i>cookie<\/i><b>, <br \/> unsigned int<\/b> <i>flag<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"21%\">\n<p><b>LA_SER_ORIG<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"63%\">\n<p>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>dlopen<\/b>(3).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"21%\">\n<p><b>LA_SER_LIBPATH<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"63%\">\n<p><i>name<\/i> was created using a directory specified in <b>LD_LIBRARY_PATH<\/b>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"21%\">\n<p><b>LA_SER_RUNPATH<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"63%\">\n<p><i>name<\/i> was created using a directory specified in an ELF <b>DT_RPATH<\/b> or <b>DT_RUNPATH<\/b> list.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"21%\">\n<p><b>LA_SER_CONFIG<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"63%\">\n<p><i>name<\/i> was found via the <b>ldconfig<\/b>(8) cache (<i>\/etc\/ld.so.cache<\/i>).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"21%\">\n<p><b>LA_SER_DEFAULT<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"63%\">\n<p><i>name<\/i> was found via a search of one of the default directories.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"21%\">\n<p><b>LA_SER_SECURE<\/b><\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"63%\">\n<p><i>name<\/i> is specific to a secure object (unused on Linux).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_activity() <br \/> void la_activity( uintptr_t *<\/b><i>cookie<\/i><b>, unsigned int<\/b> <i>flag<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"26%\">\n<p style=\"margin-top: 1em\"><b>LA_ACT_ADD<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"60%\">\n<p style=\"margin-top: 1em\">New objects are being added to the link map.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"26%\">\n<p><b>LA_ACT_DELETE<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"60%\">\n<p>Objects are being removed from the link map.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"26%\">\n<p><b>LA_ACT_CONSISTENT<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"60%\">\n<p>Link-map activity has been completed: the map is once again consistent.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_objopen() <br \/> unsigned int la_objopen(struct link_map *<\/b><i>map<\/i><b>, Lmid_t<\/b> <i>lmid<\/i><b>, <br \/> uintptr_t *<\/b><i>cookie<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"17%\">\n<p style=\"margin-top: 1em\"><b>LM_ID_BASE<\/b><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"63%\">\n<p style=\"margin-top: 1em\">Link map is part of the initial namespace.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"17%\">\n<p><b>LM_ID_NEWLM<\/b><\/p>\n<\/td>\n<td width=\"9%\"><\/td>\n<td width=\"63%\">\n<p>Link map is part of a new namespace requested via <b>dlmopen<\/b>(3).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><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\u2019s 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>\n<p style=\"margin-left:11%; margin-top: 1em\">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>():<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"23%\">\n<p style=\"margin-top: 1em\"><b>LA_FLG_BINDTO<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"60%\">\n<p style=\"margin-top: 1em\">Audit symbol bindings to this object.<\/p>\n<\/td>\n<td width=\"3%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"23%\">\n<p><b>LA_FLG_BINDFROM<\/b><\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"60%\">\n<p>Audit symbol bindings from this object.<\/p>\n<\/td>\n<td width=\"3%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">A return value of 0 from <b>la_objopen<\/b>() indicates that no symbol bindings should be audited for this object.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_objclose() <br \/> unsigned int la_objclose(uintptr_t *<\/b><i>cookie<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">In the current implementation, the value returned by <b>la_objclose<\/b>() is ignored.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_preinit() <br \/> void la_preinit(uintptr_t *<\/b><i>cookie<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>dlopen<\/b>(3).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_symbind*() <br \/> uintptr_t la_symbind32(Elf32_Sym *<\/b><i>sym<\/i><b>, unsigned int<\/b> <i>ndx<\/i><b>, <br \/> uintptr_t *<\/b><i>refcook<\/i><b>, uintptr_t *<\/b><i>defcook<\/i><b>, <br \/> unsigned int *<\/b><i>flags<\/i><b>, const char *<\/b><i>symname<\/i><b>); <br \/> uintptr_t la_symbind64(Elf64_Sym *<\/b><i>sym<\/i><b>, unsigned int<\/b> <i>ndx<\/i><b>, <br \/> uintptr_t *<\/b><i>refcook<\/i><b>, uintptr_t *<\/b><i>defcook<\/i><b>, <br \/> unsigned int *<\/b><i>flags<\/i><b>, const char *<\/b><i>symname<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">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><elf.h><\/i>. Among the fields of this structure, <i>st_value<\/i> indicates the address to which the symbol is bound.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>ndx<\/i> argument gives the index of the symbol in the symbol table of the bound shared object.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>symname<\/i> argument points a string containing the name of the symbol.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"24%\">\n<p style=\"margin-top: 1em\"><b>LA_SYMB_DLSYM<\/b><\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"55%\">\n<p style=\"margin-top: 1em\">The binding resulted from a call to <b>dlsym<\/b>(3).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"24%\">\n<p><b>LA_SYMB_ALTVALUE<\/b><\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"55%\">\n<p>A previous <b>la_symbind*<\/b>() call returned an alternate value for this symbol.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">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:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"27%\">\n<p style=\"margin-top: 1em\"><b>LA_SYMB_NOPLTENTER<\/b><\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"55%\">\n<p style=\"margin-top: 1em\">Don\u2019t call <b>la_pltenter<\/b>() for this symbol.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"27%\">\n<p><b>LA_SYMB_NOPLTEXIT<\/b><\/p>\n<\/td>\n<td width=\"7%\"><\/td>\n<td width=\"55%\">\n<p>Don\u2019t call <b>la_pltexit<\/b>() for this symbol.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">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\u2212>st_value<\/i>. A different value may be returned if the library wishes to direct control to an alternate location.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_pltenter()<\/b> <br \/> The precise name and argument types for this function depend on the hardware platform. (The appropriate definition is supplied by <i><link.h><\/i>.) Here is the definition for x86-32:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Elf32_Addr la_i86_gnu_pltenter(Elf32_Sym *<\/b><i>sym<\/i><b>, unsigned int<\/b> <i>ndx<\/i><b>, <br \/> uintptr_t *<\/b><i>refcook<\/i><b>, uintptr_t *<\/b><i>defcook<\/i><b>, <br \/> La_i86_regs *<\/b><i>regs<\/i><b>, unsigned int *<\/b><i>flags<\/i><b>, <br \/> const char *<\/b><i>symname<\/i><b>, long *<\/b><i>framesizep<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This function is invoked just before a PLT entry is called, between two shared objects that have been marked for binding notification.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>regs<\/i> argument points to a structure (defined in <i><link.h><\/i>) containing the values of registers to be used for the call to this PLT entry.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>framesizep<\/i> argument points to a <i>long\u00a0int<\/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>\n<p style=\"margin-left:11%; margin-top: 1em\">The return value of <b>la_pltenter<\/b>() is as for <b>la_symbind*<\/b>().<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>la_pltexit()<\/b> <br \/> The precise name and argument types for this function depend on the hardware platform. (The appropriate definition is supplied by <i><link.h><\/i>.) Here is the definition for x86-32:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>unsigned int la_i86_gnu_pltexit(Elf32_Sym *<\/b><i>sym<\/i><b>, unsigned int<\/b> <i>ndx<\/i><b>, <br \/> uintptr_t *<\/b><i>refcook<\/i><b>, uintptr_t *<\/b><i>defcook<\/i><b>, <br \/> const La_i86_regs *<\/b><i>inregs<\/i><b>, La_i86_retval *<\/b><i>outregs<\/i><b>, <br \/> const char *<\/b><i>symname<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">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>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>inregs<\/i> argument points to a structure (defined in <i><link.h><\/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><link.h><\/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>\n<p style=\"margin-left:11%; margin-top: 1em\">In the current GNU implementation, the return value of <b>la_pltexit<\/b>() is ignored.<\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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>.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Note the following differences from the Solaris dynamic linker auditing API:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p style=\"margin-top: 1em\">The Solaris <b>la_objfilter<\/b>() interface is not supported by the GNU implementation.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p>The Solaris <b>la_symbind32<\/b>() and <b>la_pltexit<\/b>() functions do not provide a <i>symname<\/i> argument.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>*<\/p>\n<\/td>\n<td width=\"3%\"><\/td>\n<td width=\"85%\">\n<p>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).<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">#include <link.h> #include <stdio.h><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">unsigned int <br \/> la_version(unsigned int version) <br \/> { <br \/> printf(&#8220;la_version(): version = %u; LAV_CURRENT = %un&#8221;, <br \/> version, LAV_CURRENT);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return LAV_CURRENT; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">char bodies manpages.csv script_extrae_body.sh script.sh usr <br \/> la_objsearch(const char *name, uintptr_t *cookie, unsigned int flag) <br \/> { <br \/> printf(&#8220;la_objsearch(): name = %s; cookie = %p&#8221;, name, cookie); <br \/> printf(&#8220;; flag = %sn&#8221;, <br \/> (flag == LA_SER_ORIG) ? &#8220;LA_SER_ORIG&#8221; : <br \/> (flag == LA_SER_LIBPATH) ? &#8220;LA_SER_LIBPATH&#8221; : <br \/> (flag == LA_SER_RUNPATH) ? &#8220;LA_SER_RUNPATH&#8221; : <br \/> (flag == LA_SER_DEFAULT) ? &#8220;LA_SER_DEFAULT&#8221; : <br \/> (flag == LA_SER_CONFIG) ? &#8220;LA_SER_CONFIG&#8221; : <br \/> (flag == LA_SER_SECURE) ? &#8220;LA_SER_SECURE&#8221; : <br \/> &#8220;???&#8221;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return name; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">void <br \/> la_activity (uintptr_t *cookie, unsigned int flag) <br \/> { <br \/> printf(&#8220;la_activity(): cookie = %p; flag = %sn&#8221;, cookie, <br \/> (flag == LA_ACT_CONSISTENT) ? &#8220;LA_ACT_CONSISTENT&#8221; : <br \/> (flag == LA_ACT_ADD) ? &#8220;LA_ACT_ADD&#8221; : <br \/> (flag == LA_ACT_DELETE) ? &#8220;LA_ACT_DELETE&#8221; : <br \/> &#8220;???&#8221;); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">unsigned int <br \/> la_objopen(struct link_map *map, Lmid_t lmid, uintptr_t *cookie) <br \/> { <br \/> printf(&#8220;la_objopen(): loading &#8220;%s&#8221;; lmid = %s; cookie=%pn&#8221;, <br \/> map\u2212>l_name, <br \/> (lmid == LM_ID_BASE) ? &#8220;LM_ID_BASE&#8221; : <br \/> (lmid == LM_ID_NEWLM) ? &#8220;LM_ID_NEWLM&#8221; : <br \/> &#8220;???&#8221;, <br \/> cookie);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return LA_FLG_BINDTO | LA_FLG_BINDFROM; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">unsigned int <br \/> la_objclose (uintptr_t *cookie) <br \/> { <br \/> printf(&#8220;la_objclose(): %pn&#8221;, cookie);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return 0; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">void <br \/> la_preinit(uintptr_t *cookie) <br \/> { <br \/> printf(&#8220;la_preinit(): %pn&#8221;, cookie); <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">uintptr_t <br \/> la_symbind32(Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook, <br \/> uintptr_t *defcook, unsigned int *flags, const char *symname) <br \/> { <br \/> printf(&#8220;la_symbind32(): symname = %s; sym\u2212>st_value = %pn&#8221;, <br \/> symname, sym\u2212>st_value); <br \/> printf(&#8221; ndx = %u; flags = %#x&#8221;, ndx, *flags); <br \/> printf(&#8220;; refcook = %p; defcook = %pn&#8221;, refcook, defcook);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return sym\u2212>st_value; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">uintptr_t <br \/> la_symbind64(Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook, <br \/> uintptr_t *defcook, unsigned int *flags, const char *symname) <br \/> { <br \/> printf(&#8220;la_symbind64(): symname = %s; sym\u2212>st_value = %pn&#8221;, <br \/> symname, sym\u2212>st_value); <br \/> printf(&#8221; ndx = %u; flags = %#x&#8221;, ndx, *flags); <br \/> printf(&#8220;; refcook = %p; defcook = %pn&#8221;, refcook, defcook);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return sym\u2212>st_value; <br \/> }<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Elf32_Addr <br \/> 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 *framesizep) <br \/> { <br \/> printf(&#8220;la_i86_gnu_pltenter(): %s (%p)n&#8221;, symname, sym\u2212>st_value);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">return sym\u2212>st_value; <br \/> }<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ldd<\/b>(1), <b>dlopen<\/b>(3), <b>ld.so<\/b>(8), <b>ldconfig<\/b>(8)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 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 https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  rtld-audit \u2212 auditing API for the dynamic linker <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,972,1162],"class_list":["post-4082","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-rtld-audit"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4082"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4082\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}