Linking

Though linking occurs automatically, the options in the following table allow you to direct input and output to the linker, controlling how the linker processes your object files.

You can actually include ld options on the compiler command line, because the compiler passes unrecognized options on to the linker.

Related information: The -qextchk option enables some extra consistency checking during linking.
Table 1. Linking options
Option name @PROCESS directive Description
-b64 None.

In 64-bit mode, instructs the linker to bind with 64-bit objects.

-bdynamic, -bshared, and -bstatic None.

These options are toggles that are used to control the processing of -l options and the way that shared objects are processed.

-bhalt None.

Specifies the maximum error level that is allowed before the linker (ld) command halts.

-bloadmap None.

Saves a log of linker actions and messages in the specified file name.

-bmaxdata, -bmaxstack None.

Specifies the maximum amount of space to reserve for the program data segment and stack segment for programs where the size of these regions is a constraint.

-brtl None.

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.

-e None.

When used together with the -qmkshrobj option or -G option, specifies an entry point for a shared object.

-L None.

Searches the directory path for library files specified by the -l option.

-l None.

Searches for the specified library file. For static and dynamic linking, the linker searches for libkey.a. For runtime linking with the -brtl option, the linker searches for libkey.so, and then libkey.a if libkey.so is not found.



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