tejohnson created this revision. tejohnson added a reviewer: pcc. Herald added subscribers: dexonsmith, steven_wu, hiraditya, inglorion. Herald added a project: clang.
Documents interaction of linker option added in D71913 <https://reviews.llvm.org/D71913> with LTO visibility. Repository: rG LLVM Github Monorepo 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.
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.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits