Bug #10346
closedld(1) should not reduce symbol visibility of COMDAT symbols when producing relocatable objects
100%
Description
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
symbols.
With old-style comdat a similar problem occurs, to the extent that instances of the symbol no longer match, see #6094
Related issues
Updated by Rich Lowe over 4 years ago
- Related to Bug #6094: SPARC: gcc48 build: ld: warning: relocation warning: R_SPARC_WPLT30 added
Updated by Rich Lowe over 4 years ago
- Related to Bug #7487: ld failed on sparc with relocation added
Updated by Rich Lowe about 4 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 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit c524b4fe42d7c586615aacae917f985e3379a108
commit c524b4fe42d7c586615aacae917f985e3379a108 Author: Richard Lowe <richlowe@richlowe.net> 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 <tsoome@me.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>