[PATCH] D75655: [Docs] Document -lto-whole-program-visibility

Teresa Johnson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 13:12:28 PST 2020


tejohnson updated this revision to Diff 248582.
tejohnson marked an inline comment as done.
tejohnson added a comment.

Fix gold plugin option


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75655/new/

https://reviews.llvm.org/D75655

Files:
  clang/docs/LTOVisibility.rst


Index: clang/docs/LTOVisibility.rst
===================================================================
--- clang/docs/LTOVisibility.rst
+++ clang/docs/LTOVisibility.rst
@@ -35,6 +35,16 @@
 (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
+can be used when it is known that the LTO link has whole program visibility,
+because we are LTO linking all translation units as bitcode, except certain
+(e.g.  system) libraries or other native objects known to be safe by the user or
+build system, and the binary will not dlopen any libraries deriving from the
+binary’s classes. This is useful in situations where it is not safe to specify
+``-fvisibility=hidden`` at compile time.
+
 A class defined in a translation unit built without LTO receives public
 LTO visibility regardless of its object file visibility, linkage or other
 attributes.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75655.248582.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200305/9ecb5534/attachment.bin>


More information about the cfe-commits mailing list