-brtl

Category

Linking

Pragma equivalent

None.

Purpose

Enables runtime linking for the output file. When you use -brtl with the -l option, the linker searches for a library with the suffix of .so, as well as of .a. Preference is given to .so over .a when libraries with the same name are present in the same directory.

Runtime linking is the ability to resolve undefined and non-deferred symbols in shared modules after the program execution has already begun. It is a mechanism for providing runtime definitions (these function definitions are not available at link-time) and symbol rebinding capabilities. Compiling with -brtl adds a reference to the runtime linker to your program, which will be called by your program's startup code (/lib/crt0.o) when program execution begins. Shared object input files are listed as dependents in the program loader section in the same order as they are specified on the command line. When the program execution begins, the system loader loads these shared objects so their definitions are available to the runtime linker.

Syntax

Read syntax diagramSkip visual syntax diagram
>>- -brtl------------------------------------------------------><

Usage

The main application must be built to enable runtime linking. The system loader must be able to load and resolve all symbols referenced in the main program and called modules, or the program will not execute. For how to link a library to an application with runtime linking enabled, see Linking a library to an application.

DCE thread libraries and heap debug libraries are not compatible with runtime linking. Do not specify the -brtl compiler option if you are invoking the compiler with xlC_r4, or if the -qheapdebug compiler option is specified.

Predefined macros

None.

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us