xref: /llvm-project/llvm/docs/CommandGuide/llvm-install-name-tool.rst (revision bbce75e352be0637305a1b59ac5eca7175bceece)
1bb4b70f7SSameer Arorallvm-install-name-tool - LLVM tool for manipulating install-names and rpaths
2bb4b70f7SSameer Arora============================================================================
3bb4b70f7SSameer Arora
4bb4b70f7SSameer Arora.. program:: llvm-install-name-tool
5bb4b70f7SSameer Arora
6bb4b70f7SSameer AroraSYNOPSIS
7bb4b70f7SSameer Arora--------
8bb4b70f7SSameer Arora
9bb4b70f7SSameer Arora:program:`llvm-install-name-tool` [*options*] *input*
10bb4b70f7SSameer Arora
11bb4b70f7SSameer AroraDESCRIPTION
12bb4b70f7SSameer Arora-----------
13bb4b70f7SSameer Arora
14bb4b70f7SSameer Arora:program:`llvm-install-name-tool` is a tool to manipulate dynamic shared library
15bb4b70f7SSameer Arorainstall names and rpaths listed in a Mach-O binary.
16bb4b70f7SSameer Arora
17bb4b70f7SSameer AroraFor most scenarios, it works as a drop-in replacement for Apple's
18bb4b70f7SSameer Arora:program:`install_name_tool`.
19bb4b70f7SSameer Arora
20bb4b70f7SSameer AroraOPTIONS
21bb4b70f7SSameer Arora--------
22bb4b70f7SSameer AroraAt least one of the following options are required, and some options can be
23612b4ddaSSameer Aroracombined with other options. Options :option:`-add_rpath`, :option:`-delete_rpath`,
24612b4ddaSSameer Aroraand :option:`-rpath` can be combined in an invocation only if they do not share
25612b4ddaSSameer Arorathe same `<rpath>` value.
26bb4b70f7SSameer Arora
27bb4b70f7SSameer Arora.. option:: -add_rpath <rpath>
28bb4b70f7SSameer Arora
29bb4b70f7SSameer Arora Add an rpath named ``<rpath>`` to the specified binary. Can be specified multiple
30bb4b70f7SSameer Arora times to add multiple rpaths. Throws an error if ``<rpath>`` is already listed in
31bb4b70f7SSameer Arora the binary.
32bb4b70f7SSameer Arora
33612b4ddaSSameer Arora.. option:: -change <old_install_name> <new_install_name>
34612b4ddaSSameer Arora
35612b4ddaSSameer Arora Change an install name ``<old_install_name>`` to ``<new_install_name>`` in the
36612b4ddaSSameer Arora specified binary. Can be specified multiple times to change multiple dependent shared
37612b4ddaSSameer Arora library install names. Option is ignored if ``<old_install_name>`` is not listed
38e8fa9014SKazu Hirata in the specified binary.
39612b4ddaSSameer Arora
40bb4b70f7SSameer Arora.. option:: -delete_rpath <rpath>
41bb4b70f7SSameer Arora
42bb4b70f7SSameer Arora Delete an rpath named ``<rpath>`` from the specified binary. Can be specified multiple
43bb4b70f7SSameer Arora times to delete multiple rpaths. Throws an error if ``<rpath>`` is not listed in
44bb4b70f7SSameer Arora the binary.
45bb4b70f7SSameer Arora
4661133e0bSTobias Hieta.. option:: -delete_all_rpaths
4761133e0bSTobias Hieta
4861133e0bSTobias Hieta  Deletes all rpaths from the binary.
4961133e0bSTobias Hieta
5053ba045fSAlexander Shaposhnikov.. option:: --help, -h
5153ba045fSAlexander Shaposhnikov
5253ba045fSAlexander Shaposhnikov Print a summary of command line options.
5353ba045fSAlexander Shaposhnikov
54612b4ddaSSameer Arora.. option:: -id <name>
55612b4ddaSSameer Arora
56612b4ddaSSameer Arora Change shared library's identification name under LC_ID_DYLIB to ``<name>`` in the
57e8fa9014SKazu Hirata specified binary. If specified multiple times, only the last :option:`-id` option is
58612b4ddaSSameer Arora selected. Option is ignored if the specified Mach-O binary is not a dynamic shared library.
59612b4ddaSSameer Arora
60612b4ddaSSameer Arora.. option:: -rpath <old_rpath> <new_rpath>
61612b4ddaSSameer Arora
62612b4ddaSSameer Arora Change an rpath named ``<old_rpath>`` to ``<new_rpath>`` in the specified binary. Can be specified
63612b4ddaSSameer Arora multiple times to change multiple rpaths. Throws an error if ``<old_rpath>`` is not listed
64612b4ddaSSameer Arora in the binary or ``<new_rpath>`` is already listed in the binary.
65612b4ddaSSameer Arora
6653ba045fSAlexander Shaposhnikov.. option:: --version, -V
6753ba045fSAlexander Shaposhnikov
6853ba045fSAlexander Shaposhnikov Display the version of the :program:`llvm-install-name-tool` executable.
6953ba045fSAlexander Shaposhnikov
70bb4b70f7SSameer AroraEXIT STATUS
71bb4b70f7SSameer Arora-----------
72bb4b70f7SSameer Arora
73612b4ddaSSameer Arora:program:`llvm-install-name-tool` exits with a non-zero exit code if there is an error.
74bb4b70f7SSameer AroraOtherwise, it exits with code 0.
75bb4b70f7SSameer Arora
76bb4b70f7SSameer AroraBUGS
77bb4b70f7SSameer Arora----
78bb4b70f7SSameer Arora
79*bbce75e3SChuanqi XuTo report bugs, please visit <https://github.com/llvm/llvm-project/labels/tools:llvm-objcopy/strip/>.
80bb4b70f7SSameer Arora
81bb4b70f7SSameer AroraSEE ALSO
82bb4b70f7SSameer Arora--------
83bb4b70f7SSameer Arora
84bb4b70f7SSameer Arora:manpage:`llvm-objcopy(1)`
85