05.06.2014 Views

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

© 2012, <strong>QNX</strong> <strong>Software</strong> Systems Limited Optimizing the runtime linker<br />

Diagnostics and debugging<br />

dependency. As a consequence, lazy loading can’t be transparent as, for example, lazy<br />

binding is (lazy binding doesn’t change the lookup scope, only the time of the symbol<br />

lookup).<br />

When you’re developing a complex application, it may become difficult to understand<br />

how the dynamic linker lays out the internal link maps and scopes of resolution. To<br />

help determine what exactly the dynamic linker is doing, you can use the<br />

DL_DEBUG environment variable to make the linker display diagnostic messages.<br />

Diagnostic messages are categorized, and the value of DL_DEBUG determines which<br />

categories are displayed. The special category help doesn’t produce diagnostics<br />

messages, but rather displays a help message and then terminates the application.<br />

To redirect diagnostic messages to a file, set the LD_DEBUG_OUTPUT<br />

environment variable to the full path of the output file.<br />

For security reasons, the use of LD_DEBUG_OUTPUT with setuid binaries is<br />

disabled.<br />

Environment variables<br />

The following environment variables affect the operation of the dynamic linker:<br />

DL_DEBUG<br />

Display diagnostic messages. The value can be a<br />

comma-separated list of the following:<br />

• all — display all debug messages.<br />

• help — display a help message, and then exit.<br />

• reloc — display relocation processing messages.<br />

• libs — display information about shared objects being<br />

opened.<br />

• statistics — display runtime linker statistics.<br />

• lazyload — print lazy-load debug messages.<br />

• debug — print various runtime linker debug messages.<br />

A value of 1 (one) is the same as all.<br />

LD_DEBUG<br />

A synonym for DL_DEBUG; if you set both variables,<br />

DL_DEBUG takes precedence.<br />

LD_DEBUG_OUTPUT<br />

The name of a file in which the dynamic linker writes its<br />

output. By default, output is written to stderr.<br />

June 14, 2012 Chapter 1 • Compiling and Debugging 21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!