Skip to main content

IAR Embedded Workbench for Arm 9.70.x

‑‑shared (compiler option)

In this section:
Syntax

‑‑shared

Description

This is a compiler option.

Use this option to generate code that can be linked into a shared object output file, instead of an executable output file. Specifying this option also has the same effect as specifying the compiler options ‑‑ropi, ‑‑rwpi=got, and ‑‑visibility=hidden.

The option also makes the compiler handle visibility attributes—when not compiling for shared objects, the visibility attributes are ignored.

Note

This option is not available for Armv8-M baseline, Armv6-M, or in 64-bit mode (the implementation requires the Arm or Thumb2 instruction set).

See also

Shared objects (32-bit mode only) and ‑‑shared (linker option).

Caution

Project>Options>General Options>Output>Shared object