diff options
author | Richard Dzenis <richard@dzenis.dev> | 2024-12-24 16:05:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-24 16:05:10 +0200 |
commit | 334a5766d7591bfaadf6990b3d8568c9688e22a5 (patch) | |
tree | 487b7b50013baa0df20a5490014ef533cdad227e /llvm/docs/CommandGuide/llvm-objcopy.rst | |
parent | 8e1cb96db84a70b2c803c28a359c8bb71395f35e (diff) | |
download | llvm-334a5766d7591bfaadf6990b3d8568c9688e22a5.zip llvm-334a5766d7591bfaadf6990b3d8568c9688e22a5.tar.gz llvm-334a5766d7591bfaadf6990b3d8568c9688e22a5.tar.bz2 |
[llvm-objcopy] Add support of symbol modification flags for MachO (#120895)
This patch adds support of the following llvm-objcopy flags for MachO:
- `--globalize-symbol`, `--globalize-symbols`,
- `--keep-global-symbol`, `-G`, `--keep-global-symbols`,
- `--localize-symbol`, `-L`, `--localize-symbols`,
- `--skip-symbol`, `--skip-symbols`.
Code in `updateAndRemoveSymbols` for MachO
is kept similar to its version for ELF.
Fixes #120894
Diffstat (limited to 'llvm/docs/CommandGuide/llvm-objcopy.rst')
-rw-r--r-- | llvm/docs/CommandGuide/llvm-objcopy.rst | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/llvm/docs/CommandGuide/llvm-objcopy.rst b/llvm/docs/CommandGuide/llvm-objcopy.rst index e6af47c..be4876c 100644 --- a/llvm/docs/CommandGuide/llvm-objcopy.rst +++ b/llvm/docs/CommandGuide/llvm-objcopy.rst @@ -78,10 +78,47 @@ multiple file formats. Enable deterministic mode when copying archives, i.e. use 0 for archive member header UIDs, GIDs and timestamp fields. On by default. +.. option:: --globalize-symbol <symbol> + + Mark any defined symbols named ``<symbol>`` as global symbols in the output. + Can be specified multiple times to mark multiple symbols. + +.. option:: --globalize-symbols <filename> + + Read a list of names from the file ``<filename>`` and mark defined symbols with + those names as global in the output. In the file, each line represents a single + symbol, with leading and trailing whitespace ignored, as is anything following + a '#'. Can be specified multiple times to read names from multiple files. + .. option:: --help, -h Print a summary of command line options. +.. option:: --keep-global-symbol <symbol>, -G + + Mark all symbols local in the output, except for symbols with the name + ``<symbol>``. Can be specified multiple times to ignore multiple symbols. + +.. option:: --keep-global-symbols <filename> + + Mark all symbols local in the output, except for symbols named in the file + ``<filename>``. In the file, each line represents a single symbol, with leading + and trailing whitespace ignored, as is anything following a '#'. Can be + specified multiple times to read names from multiple files. + +.. option:: --localize-symbol <symbol>, -L + + Mark any defined non-common symbol named ``<symbol>`` as a local symbol in the + output. Can be specified multiple times to mark multiple symbols as local. + +.. option:: --localize-symbols <filename> + + Read a list of names from the file ``<filename>`` and mark defined non-common + symbols with those names as local in the output. In the file, each line + represents a single symbol, with leading and trailing whitespace ignored, as is + anything following a '#'. Can be specified multiple times to read names from + multiple files. + .. option:: --only-keep-debug Produce a debug file as the output that only preserves contents of sections @@ -177,6 +214,19 @@ multiple file formats. flags. - `share` = add the `IMAGE_SCN_MEM_SHARED` and `IMAGE_SCN_MEM_READ` flags. +.. option:: --skip-symbol <symbol> + + Do not change the parameters of symbol ``<symbol>`` when executing other + options that can change the symbol's name, binding or visibility. + +.. option:: --skip-symbols <filename> + + Do not change the parameters of symbols named in the file ``<filename>`` when + executing other options that can change the symbol's name, binding or + visibility. In the file, each line represents a single symbol, with leading + and trailing whitespace ignored, as is anything following a '#'. + Can be specified multiple times to read names from multiple files. + .. option:: --strip-all-gnu Remove all symbols, debug sections and relocations from the output. This option @@ -355,18 +405,6 @@ them. For binary outputs, fill the gaps between sections with ``<value>`` instead of zero. The value must be an unsigned 8-bit integer. -.. option:: --globalize-symbol <symbol> - - Mark any defined symbols named ``<symbol>`` as global symbols in the output. - Can be specified multiple times to mark multiple symbols. - -.. option:: --globalize-symbols <filename> - - Read a list of names from the file ``<filename>`` and mark defined symbols with - those names as global in the output. In the file, each line represents a single - symbol, with leading and trailing whitespace ignored, as is anything following - a '#'. Can be specified multiple times to read names from multiple files. - .. option:: --input-target <format>, -I Read the input as the specified format. See `SUPPORTED FORMATS`_ for a list of @@ -377,18 +415,6 @@ them. Keep symbols of type `STT_FILE`, even if they would otherwise be stripped. -.. option:: --keep-global-symbol <symbol>, -G - - Mark all symbols local in the output, except for symbols with the name - ``<symbol>``. Can be specified multiple times to ignore multiple symbols. - -.. option:: --keep-global-symbols <filename> - - Mark all symbols local in the output, except for symbols named in the file - ``<filename>``. In the file, each line represents a single symbol, with leading - and trailing whitespace ignored, as is anything following a '#'. Can be - specified multiple times to read names from multiple files. - .. option:: --keep-section <section> When removing sections from the output, do not remove sections named @@ -410,19 +436,6 @@ them. Mark all symbols with hidden or internal visibility local in the output. -.. option:: --localize-symbol <symbol>, -L - - Mark any defined non-common symbol named ``<symbol>`` as a local symbol in the - output. Can be specified multiple times to mark multiple symbols as local. - -.. option:: --localize-symbols <filename> - - Read a list of names from the file ``<filename>`` and mark defined non-common - symbols with those names as local in the output. In the file, each line - represents a single symbol, with leading and trailing whitespace ignored, as is - anything following a '#'. Can be specified multiple times to read names from - multiple files. - .. option:: --new-symbol-visibility <visibility> Specify the visibility of the symbols automatically created when using binary @@ -489,19 +502,6 @@ them. Read a list of symbols from <filename> and change their visibility to the specified value. Visibility values: default, internal, hidden, protected. -.. option:: --skip-symbol <symbol> - - Do not change the parameters of symbol ``<symbol>`` when executing other - options that can change the symbol's name, binding or visibility. - -.. option:: --skip-symbols <filename> - - Do not change the parameters of symbols named in the file ``<filename>`` when - executing other options that can change the symbol's name, binding or - visibility. In the file, each line represents a single symbol, with leading - and trailing whitespace ignored, as is anything following a '#'. - Can be specified multiple times to read names from multiple files. - .. option:: --split-dwo <dwo-file> Equivalent to running :program:`llvm-objcopy` with :option:`--extract-dwo` and |