Skip to content

Commit

Permalink
[Docs] Document --lto-whole-program-visibility
Browse files Browse the repository at this point in the history
Summary:
Documents interaction of linker option added in D71913 with LTO
visibility.

Reviewers: pcc

Subscribers: inglorion, hiraditya, steven_wu, dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75655
  • Loading branch information
teresajohnson committed Aug 26, 2020
1 parent 30967e5 commit 72bdb41
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions clang/docs/LTOVisibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ other classes receive hidden LTO visibility. Classes with internal linkage
(e.g. classes declared in unnamed namespaces) also receive hidden LTO
visibility.

During the LTO link, all classes with public LTO visibility will be refined
to hidden LTO visibility when the ``--lto-whole-program-visibility`` lld linker
option is applied (``-plugin-opt=whole-program-visibility`` for gold). This flag
can be used to defer specifying whether classes have hidden LTO visibility until
link time, to allow bitcode objects to be shared by different LTO links.
Due to an implementation limitation, symbols associated with classes with hidden
LTO visibility may still be exported from the binary when using this flag. It is
unsafe to refer to these symbols, and their visibility may be relaxed to hidden
in a future compiler release.

A class defined in a translation unit built without LTO receives public
LTO visibility regardless of its object file visibility, linkage or other
attributes.
Expand Down

0 comments on commit 72bdb41

Please sign in to comment.