Linker and Libraries Guide

COMDAT Section

COMDAT sections are uniquely identified by their section name (sh_name). If the link-editor encounters multiple sections of type SHT_SUNW_COMDAT, with the same section name, the first section is retained and the rest discarded. Any relocations applied to a discarded SHT_SUNW_COMDAT section are ignored. Any symbols defined in a discarded section are removed.

Additionally, the link-editor supports the section naming convention used for section reordering when the compiler is invoked with the -xF option. If a function is placed in a section with the name .sectname%funcname, the final SHT_SUNW_COMDAT sections that are retained are coalesced into a section identified by .sectname. Using this method, the SHT_SUNW_COMDAT sections are placed into the .text, .data, or any other section as their final destination.