Linker and Libraries Guide

Recording Global Auditors

Global auditing requirements can be established by setting the environment variable LD_AUDIT. For example, this environment variable can be used to audit the application main together with all the dependencies of the application, with the audit library

$ main

Global auditing can also be achieved by recording a local auditor in the application, together with the -z globalaudit option. For example, the application main can be built to enable global auditing by using the link-editor's -P option and -z globalaudit option.

$ cc -o main main.c -Wl, -z globalaudit
$ elfdump -d main | grep AUDIT
       [3]  DEPAUDIT          0x1b2     
      [26]  FLAGS_1           0x1000000           [ GLOBAL-AUDITING ]

The auditing enabled through either of these mechanisms results in the audit library being passed information regarding all of the dynamic objects of the application.