[llvm-branch-commits] [clang] ce9f3f1 - [Docs] Document --lto-whole-program-visibility
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Aug 26 07:28:02 PDT 2020
Author: Teresa Johnson
Date: 2020-08-26T16:27:40+02:00
New Revision: ce9f3f19f512f78c5d9ffb2753bae7bcb203161b
URL: https://github.com/llvm/llvm-project/commit/ce9f3f19f512f78c5d9ffb2753bae7bcb203161b
DIFF: https://github.com/llvm/llvm-project/commit/ce9f3f19f512f78c5d9ffb2753bae7bcb203161b.diff
LOG: [Docs] Document --lto-whole-program-visibility
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
(cherry picked from commit 72bdb41a06a27b5453bf966a0ffecfa6f5fae1a6)
Added:
Modified:
clang/docs/LTOVisibility.rst
Removed:
################################################################################
diff --git a/clang/docs/LTOVisibility.rst b/clang/docs/LTOVisibility.rst
index 3a60f54e1b90..cdc0b9cc0e19 100644
--- a/clang/docs/LTOVisibility.rst
+++ b/clang/docs/LTOVisibility.rst
@@ -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
diff erent 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.
More information about the llvm-branch-commits
mailing list