The ‘ld.so --list-diagnostics’ produces machine-readable diagnostics output. This output contains system data that affects the behavior of the GNU C Library, and potentially application behavior as well.
The exact set of diagnostic items can change between releases of the GNU C Library. The output format itself is not expected to change radically.
The following table shows some example lines that can be written by the diagnostics command.
dl_pagesize=0x1000
The system page size is 4096 bytes.
env[0x14]="LANG=en_US.UTF-8"
This item indicates that the 21st environment variable at process
startup contains a setting for LANG
.
env_filtered[0x22]="DISPLAY"
The 35th environment variable is DISPLAY
. Its value is not
included in the output for privacy reasons because it is not recognized
as harmless by the diagnostics code.
path.prefix="/usr"
This means that the GNU C Library was configured with --prefix=/usr
.
path.system_dirs[0x0]="/lib64/"
path.system_dirs[0x1]="/usr/lib64/"
The built-in dynamic linker search path contains two directories,
/lib64
and /usr/lib64
.
As seen above, diagnostic lines assign values (integers or strings) to a sequence of labeled subscripts, separated by ‘.’. Some subscripts have integer indices associated with them. The subscript indices are not necessarily contiguous or small, so an associative array should be used to store them. Currently, all integers fit into the 64-bit unsigned integer range. Every access path to a value has a fixed type (string or integer) independent of subscript index values. Likewise, whether a subscript is indexed does not depend on previous indices (but may depend on previous subscript labels).
A syntax description in ABNF (RFC 5234) follows. Note that
%x30-39
denotes the range of decimal digits. Diagnostic output
lines are expected to match the line
production.
HEXDIG = %x30-39 / %x61-6f ; lowercase a-f only ALPHA = %x41-5a / %x61-7a / %x7f ; letters and underscore ALPHA-NUMERIC = ALPHA / %x30-39 / "_" DQUOTE = %x22 ; " ; Numbers are always hexadecimal and use a 0x prefix. hex-value-prefix = %x30 %x78 hex-value = hex-value-prefix 1*HEXDIG ; Strings use octal escape sequences and \\, \". string-char = %x20-21 / %x23-5c / %x5d-7e ; printable but not "\ string-quoted-octal = %x30-33 2*2%x30-37 string-quoted = "\" ("\" / DQUOTE / string-quoted-octal) string-value = DQUOTE *(string-char / string-quoted) DQUOTE value = hex-value / string-value label = ALPHA *ALPHA-NUMERIC index = "[" hex-value "]" subscript = label [index] line = subscript *("." subscript) "=" value
As mentioned above, the set of diagnostics may change between the GNU C Library releases. Nevertheless, the following table documents a few common diagnostic items. All numbers are in hexadecimal, with a ‘0x’ prefix.
dl_dst_lib=string
The $LIB
dynamic string token expands to string.
dl_hwcap=integer
dl_hwcap2=integer
The HWCAP and HWCAP2 values, as returned for getauxval
, and as
used in other places depending on the architecture.
dl_pagesize=integer
The system page size is integer bytes.
dl_platform=string
The $PLATFORM
dynamic string token expands to string.
dso.libc=string
This is the soname of the shared libc
object that is part of
the GNU C Library. On most architectures, this is libc.so.6
.
env[index]=string
env_filtered[index]=string
An environment variable from the process environment. The integer
index is the array index in the environment array. Variables
under env
include the variable value after the ‘=’ (assuming
that it was present), variables under env_filtered
do not.
path.prefix=string
This indicates that the GNU C Library was configured using ‘--prefix=string’.
path.sysconfdir=string
The GNU C Library was configured (perhaps implicitly) with
‘--sysconfdir=string’ (typically /etc
).
path.system_dirs[index]=string
These items list the elements of the built-in array that describes the default library search path. The value string is a directory file name with a trailing ‘/’.
path.rtld=string
This string indicates the application binary interface (ABI) file name of the run-time dynamic linker.
version.release="stable"
version.release="development"
The value "stable"
indicates that this build of the GNU C Library is
from a release branch. Releases labeled as "development"
are
unreleased development versions.
version.version="major.minor"
version.version="major.minor.9000"
The GNU C Library version. Development releases end in ‘.9000’.
auxv[index].a_type=type
auxv[index].a_val=integer
auxv[index].a_val_string=string
An entry in the auxiliary vector (specific to Linux). The values
type (an integer) and integer correspond to the members of
struct auxv
. If the value is a string, a_val_string
is
used instead of a_val
, so that values have consistent types.
The AT_HWCAP
and AT_HWCAP2
values in this output do not
reflect adjustment by the GNU C Library.
uname.sysname=string
uname.nodename=string
uname.release=string
uname.version=string
uname.machine=string
uname.domain=string
These Linux-specific items show the values of struct utsname
, as
reported by the uname
function. See Platform Type Identification.
x86.cpu_features.…
These items are specific to the i386 and x86-64 architectures. They
reflect supported CPU features and information on cache geometry, mostly
collected using the CPUID
instruction.