Project

General

Profile

Actions

Bug #10346

closed

ld(1) should not reduce symbol visibility of COMDAT symbols when producing relocatable objects

Added by Rich Lowe over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2019-02-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

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

Related to illumos gate - Bug #6094: SPARC: gcc48 build: ld: warning: relocation warning: R_SPARC_WPLT30ClosedRich Lowe2015-08-01

Actions
Related to illumos gate - Bug #7487: ld failed on sparc with relocationClosedRich Lowe2016-10-21

Actions
Actions #1

Updated by Rich Lowe over 4 years ago

  • Related to Bug #6094: SPARC: gcc48 build: ld: warning: relocation warning: R_SPARC_WPLT30 added
Actions #2

Updated by Rich Lowe over 4 years ago

  • Related to Bug #7487: ld failed on sparc with relocation added
Actions #3

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.

Actions #4

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>

Actions

Also available in: Atom PDF