Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 7/13/2023
Public
Document Table of Contents

fdata-sections, Gw

Places each data item in its own COMDAT section.

Syntax

Linux:

-fdata-sections

macOS:

-fdata-sections

Windows:

/Gw

Arguments

None

Default

OFF

The compiler does not separate functions into COMDATs.

Description

This option places each data item in its own COMDAT section.

When using this compiler option, you can add the linker option -Wl,--gc-sections (LInux) or /link /OPT:REF (Windows), which will remove all unused code.

NOTE:

When you put each data item in its own section, it enables the linker to reorder the sections for other possible optimization.

Alternate Options

None

See Also