summaryrefslogtreecommitdiffstats
path: root/llvm/docs/LangRef.rst
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r--llvm/docs/LangRef.rst32
1 files changed, 27 insertions, 5 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index af6e484c4b8..bfe0a0ab9fe 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -6081,10 +6081,10 @@ enum is the smallest type which can represent all of its values::
Automatic Linker Flags Named Metadata
=====================================
-Some targets support embedding flags to the linker inside individual object
+Some targets support embedding of flags to the linker inside individual object
files. Typically this is used in conjunction with language extensions which
-allow source files to explicitly declare the libraries they depend on, and have
-these automatically be transmitted to the linker via object files.
+allow source files to contain linker command line options, and have these
+automatically be transmitted to the linker via object files.
These flags are encoded in the IR using named metadata with the name
``!llvm.linker.options``. Each operand is expected to be a metadata node
@@ -6095,8 +6095,8 @@ For example, the following metadata section specifies two separate sets of
linker options, presumably to link against ``libz`` and the ``Cocoa``
framework::
- !0 = !{ !"-lz" },
- !1 = !{ !"-framework", !"Cocoa" } } }
+ !0 = !{ !"-lz" }
+ !1 = !{ !"-framework", !"Cocoa" }
!llvm.linker.options = !{ !0, !1 }
The metadata encoding as lists of lists of options, as opposed to a collapsed
@@ -6109,6 +6109,28 @@ Each individual option is required to be either a valid option for the target's
linker, or an option that is reserved by the target specific assembly writer or
object file emitter. No other aspect of these options is defined by the IR.
+Dependent Libs Named Metadata
+=============================
+
+Some targets support embedding of strings into object files to indicate
+a set of libraries to add to the link. Typically this is used in conjunction
+with language extensions which allow source files to explicitly declare the
+libraries they depend on, and have these automatically be transmitted to the
+linker via object files.
+
+The list is encoded in the IR using named metadata with the name
+``!llvm.dependent-libraries``. Each operand is expected to be a metadata node
+which should contain a single string operand.
+
+For example, the following metadata section contains two library specfiers::
+
+ !0 = !{!"a library specifier"}
+ !1 = !{!"another library specifier"}
+ !llvm.dependent-libraries = !{ !0, !1 }
+
+Each library specifier will be handled independently by the consuming linker.
+The effect of the library specifiers are defined by the consuming linker.
+
.. _summary:
ThinLTO Summary
OpenPOWER on IntegriCloud