Linker and Libraries Guide

Comdat Section

Sections of this type will be 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. Also 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 (see "Segment Declarations") when the compiler is invoked with the -xF option. That is, if the sections are placed in a section of the name .<funcname>%<sectname> the final SHT_SUNW_COMDAT sections which 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.