ld(1) should not reduce symbol visibility of COMDAT symbols when producing relocatable objects
1. Do not reduce symbols that are in sections that are parts of groups.
> References to the sections comprising a group from sections outside
of the group must be made through symbol table entries with STB_GLOBAL
or STB_WEAK binding and section index SHN_UNDEF. If there is a
definition of the same symbol in the object containing the references,
it must have a separate symbol table entry from the
references. Sections outside of the group may not reference symbols
with STB_LOCAL binding for addresses contained in the group's sections,
including symbols with type STT_SECTION.
Seems to suggest that a group containing externally referenced
STB_LOCAL symbols is erroneous. If we process STV_HIDDEN symbols in
groups when linking with -r and -Breduce, we will create such
With old-style comdat a similar problem occurs, to the extent that instances of the symbol no longer match, see #6094
Updated by Rich Lowe about 3 years ago
testing: libsoftcrypto build with GCC 8, checking thunks in the symbol cap object comdat correctly. libsoftcrypto built with -mindirect-branch=thunk to check that future retpoline work also be fine.
Full pkgsrc build by jperkin looking for issues.
Updated by Electric Monk about 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit c524b4fe42d7c586615aacae917f985e3379a108 Author: Richard Lowe <email@example.com> Date: 2019-04-24T16:59:37.000Z 10346 ld(1) should not reduce symbol visibility of COMDAT symbols when producing relocatable objects Reviewed by: Toomas Soome <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>