aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lld/docs/error_handling_script.rst
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-06-13 19:31:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-06-13 19:37:19 +0000
commite8d8bef961a50d4dc22501cde4fb9fb0be1b2532 (patch)
tree94f04805f47bb7c59ae29690d8952b6074fff602 /contrib/llvm-project/lld/docs/error_handling_script.rst
parentbb130ff39747b94592cb26d71b7cb097b9a4ea6b (diff)
parentb60736ec1405bb0a8dd40989f67ef4c93da068ab (diff)
Diffstat (limited to 'contrib/llvm-project/lld/docs/error_handling_script.rst')
-rw-r--r--contrib/llvm-project/lld/docs/error_handling_script.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/contrib/llvm-project/lld/docs/error_handling_script.rst b/contrib/llvm-project/lld/docs/error_handling_script.rst
new file mode 100644
index 000000000000..53efa8b7a3fb
--- /dev/null
+++ b/contrib/llvm-project/lld/docs/error_handling_script.rst
@@ -0,0 +1,39 @@
+=====================
+Error Handling Script
+=====================
+
+LLD provides the ability to hook into some error handling routines through a
+user-provided script specified with ``--error-handling-script=<path to the script>``
+when certain errors are encountered. This document specifies the requirements of
+such a script.
+
+Generic Requirements
+====================
+
+The script is expected to be available in the ``PATH`` or to be provided using a
+full path. It must be executable. It is executed in the same environment as the
+parent process.
+
+Arguments
+=========
+
+LLD calls the error handling script using the following arguments::
+
+ error-handling-script <tag> <tag-specific-arguments...>
+
+The following tags are supported:
+
+- ``missing-lib``: indicates that LLD failed to find a library. The library name
+ is specified as the second argument, e.g. ``error-handling-script missing-lib
+ mylib``
+
+- ``undefined-symbol``: indicates that given symbol is marked as undefined. The
+ unmangled symbol name is specified as the second argument, e.g.
+ ``error-handling-script undefined-symbol mysymbol``
+
+Return Value
+============
+
+Upon success, the script is expected to return 0. A non-zero value is
+interpreted as an error and reported to the user. In both cases, LLD still
+reports the original error.