Linker and Libraries Guide

Comdat Section

Comdat sections 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 one will be retained and all others will be discarded. Any relocations applied to a discarded SHT_SUNW_COMDAT section will be ignored and any symbols defined in a discarded section will not be kept.

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