-b

Category

Linking

Pragma equivalent

None.

Purpose

Sets special linker processing options. This option can be repeated.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-dynamic-.   
>>- -b--+-shared--+--------------------------------------------><
        '-static--'   

Defaults

-bdynamic

Parameters

dynamic | shared
Causes the linker to process subsequent shared objects in dynamic mode. In dynamic mode, shared objects are not statically included in the output file. Instead, the shared objects are listed in the loader section of the output file.
static
Causes the linker to process subsequent shared objects in static mode. In static mode, shared objects are statically linked in the output file.

Usage

The default option, -bdynamic, ensures that the C library (libc) links dynamically. To avoid possible problems with unresolved linker errors when linking the C library, you must add the -bdynamic option to the end of any compilation sections that use the -bstatic option.

Predefined macros

Not applicable.

Related information