OS Manuals

/usr/lib/llvm-21/bin/llvm-objcopy

Low-level virtual machine 21 - core frameworks - BPF variant

From llvm-21-bpf 21.1.8-r17 (os), captured 2026-11-05 by running llvm-objcopy --help (exit 0). permalink

OVERVIEW: llvm-objcopy tool

USAGE: llvm-objcopy [options] input [output]

OPTIONS:
  --add-gnu-debuglink=debug-file
                          Add a .gnu_debuglink for <debug-file>
  --add-section=section=file
                          Add a section named <section> with the contents of <file>
  --add-symbol=name=[section:]value[,flags]
                          Add new symbol <name> to .symtab. Accepted flags: global, local, weak, default, hidden, protected, file, section, object, function, indirect-function. Accepted but ignored for compatibility: debug, constructor, warning, indirect, synthetic, unique-object, before
  --adjust-section-vma <value>
                          Alias for --change-section-address
  --adjust-start <value>  Alias for --change-start
  --allow-broken-links    Allow the tool to remove sections even if it would leave invalid section references. The appropriate sh_link fields will be set to zero.
  --binary-architecture=<value>
                          Ignored for compatibility
  -B <value>              Alias for --binary-architecture
  --change-section-address=sectionpattern{=|+|-}val
                          Set the address of the <section> to, or adjust it by, <val>
  --change-section-lma=*{+|-}val
                          Shift LMA of non-zero-sized sections in the program header by <val>
  --change-start=incr     Add <incr> to the start address. Can be specified multiple times, all values will be applied cumulatively
  --compress-debug-sections=format
                          Compress DWARF debug sections using specified format. Supported formats: zlib, zstd. Select zlib if <format> is omitted
  --compress-sections=<section-glob>=<format>
                          Compress or decompress sections using specified format. Supported formats: zlib, zstd. Specify 'none' for decompression
  --decompress-debug-sections
                          Decompress DWARF debug sections
  --disable-deterministic-archives
                          Disable deterministic mode when operating on archives (use real values for UIDs, GIDs, and timestamps).
  --discard-all           Remove most local symbols. Different file formats may limit this to a subset. For ELF, file and section symbols are not discarded. Additionally, remove all debug sections
  --discard-locals        Remove local symbols starting with .L
  --dump-section=section=file
                          Dump contents of section named <section> into file <file>
  -D                      Alias for --enable-deterministic-archives
  --enable-deterministic-archives
                          Enable deterministic mode when operating on archives (use zero for UIDs, GIDs, and timestamps).
  --extract-dwo           Remove all sections that are not DWARF .dwo sections from file
  --extract-main-partition
                          Extract main partition from the input file
  --extract-partition=name
                          Extract named partition from input file
  -F <value>              Alias for --target
  --gap-fill=value        Fill the gaps between sections with <value> instead of zero. <value> must be an unsigned 8-bit integer. This option is only supported for ELF input and binary output
  --globalize-symbol=symbol
                          Mark <symbol> as global
  --globalize-symbols=filename
                          Read a list of symbols from <filename> and mark defined symbols with those names as global
  -G <value>              Alias for --keep-global-symbol
  -g                      Alias for --strip-debug
  --input-target=format   Read the input as the specified format
  -I <value>              Alias for --input-target
  -j <value>              Alias for --only-section
  --keep-file-symbols     Keep symbols of type STT_FILE, even if they would otherwise be stripped
  --keep-global-symbol=symbol
                          Mark all symbols local, except for symbols with the name <symbol>. Can be specified multiple times to ignore multiple symbols
  --keep-global-symbols=filename
                          Read a list of symbols from <filename> and run as if --keep-global-symbol=<symbol> is set for each one. <filename> contains one symbol per line and may contain comments beginning with '#'. Leading and trailing whitespace is stripped from each line. May be repeated to read symbols from many files
  --keep-section=section  Keep <section>
  --keep-symbol=symbol    When removing symbols, do not remove <symbol>
  --keep-symbols=filename Read a list of symbols from <filename> and run as if --keep-symbol=<symbol> is set for each one. <filename> contains one symbol per line and may contain comments beginning with '#'. Leading and trailing whitespace is stripped from each line. May be repeated to read symbols from many files
  -K <value>              Alias for --keep-symbol
  --localize-hidden       Mark all symbols that have hidden or internal visibility as local
  --localize-symbol=symbol
                          Mark any defined non-common symbol named <symbol> as local
  --localize-symbols=filename
                          Read a list of names from <filename> and mark any defined non-common symbols with those names as local
  -L <value>              Alias for --localize-symbol
  --new-symbol-visibility=<value>
                          Specify the visibility of symbols automatically created when using binary input or --add-symbol. The default is 'default'
  --no-verify-note-sections
                          Don't validate note sections
  -N <value>              Alias for --strip-symbol
  --only-keep-debug       Produce a debug file as the output that only preserves contents of sections useful for debugging purposes
  --only-section=section  Remove all but <section>
  --output-target=format  Write the output as the specified format
  -O <value>              Alias for --output-target
  --pad-to=address        Pad the output up to the load address <address>, using a value of zero or the value specified by the --gap-fill option. This option is only supported for ELF input and binary output
  --prefix-alloc-sections=prefix
                          Add <prefix> to the start of every allocated section name
  --prefix-symbols=prefix Add <prefix> to the start of every symbol name
  --preserve-dates        Preserve access and modification timestamps
  -p                      Alias for --preserve-dates
  --redefine-sym=old=new  Change the name of a symbol old to new
  --redefine-syms=filename
                          Read a list of symbol pairs from <filename> and run as if --redefine-sym=<old>=<new> is set for each one. <filename> contains two symbols per line separated with whitespace and may contain comments beginning with '#'. Leading and trailing whitespace is stripped from each line. May be repeated to read symbols from many files
  --regex                 Permit regular expressions in name comparison
  --remove-note=[name/]type_id
                          Remove note(s) with <type_id> and optional <name>
  --remove-section=section
                          Remove <section>
  --remove-symbol-prefix=prefix
                          Remove <prefix> from the start of every symbol name. No-op for symbols that do not start with <prefix>
  --rename-section=old=new[,flag1,...]
                          Rename sections called <old> to <new>, and apply any specified <flag> values. See --set-section-flags for a list of supported flags
  -R <value>              Alias for --remove-section
  --set-section-alignment=section=align
                          Set alignment for a given section
  --set-section-flags=section=flag1[,flag2,...]
                          Set section properties based on the specified <flags>. Supported flag names are: alloc, load, noload, readonly, exclude, debug, code, data, rom, share, contents, merge, strings, large
  --set-section-type=section=type
                          Set the type of section <section> to the integer <type>
  --set-start=addr        Set the start address to <addr>. Overrides any previous --change-start or --adjust-start values
  --set-symbol-visibility=symbol=visibility
                          Change the visibility of a symbol to the specified value
  --set-symbols-visibility=filename=visibility
                          Read a list of symbols from <filename> and change their visibility to the specified value. Visibility values: default, internal, hidden, protected
  --skip-symbol=symbol    Do not change parameters of symbol <symbol> when executing other options that can change the symbol's name, binding or visibility
  --skip-symbols=filename Read a list of symbols from <filename> and run as if --skip-symbol=<symbol> is set for each one. <filename> contains one symbol per line and may contain comments beginning with '#'. Leading and trailing whitespace is stripped from each line. May be repeated to read symbols from many files
  --split-dwo=dwo-file    Equivalent to --extract-dwo and <dwo-file> as the output file and no other options, and then --strip-dwo on the input file
  --strip-all-gnu         Remove all symbols, debug sections and relocations. Compatible with GNU's --strip-all
  --strip-all             For ELF, remove all symbols and non-alloc sections not within segments, except for .gnu.warning*, .ARM.attribute, and the section name table. For COFF and Mach-O, remove all symbols, debug sections, and relocations
  --strip-debug           Remove all debug sections
  --strip-dwo             Remove all DWARF .dwo sections
  --strip-non-alloc       Remove all non-allocated sections that are not within segments
  --strip-sections        Remove all section headers and all section data not within segments
  --strip-symbol=symbol   Strip <symbol>
  --strip-symbols=filename
                          Remove all symbols whose names appear in the file <filename>
  --strip-unneeded-symbol=symbol
                          Remove all symbols named <symbol> that are local or undefined and are not required by any relocation
  --strip-unneeded-symbols=filename
                          Remove all symbols whose names appear in the file <file>, if they are local or undefined and are not required by any relocation
  --strip-unneeded        Remove all symbols not needed by relocations
  -S                      Alias for --strip-all
  --target=<value>        Equivalent to --input-target and --output-target for the specified format
  --update-section=name=file
                          Replace the contents of section <name> with contents from a file <file>
  -U                      Alias for --disable-deterministic-archives
  --verify-note-sections  Validate note sections
  --version               Print the version and exit.
  -V                      Alias for --version
  --weaken-symbol=symbol  Mark global symbols named <symbol> as weak
  --weaken-symbols=filename
                          Read a list of symbols from <filename> and mark global symbols with those names as weak
  --weaken                Mark all defined global symbols as weak
  --wildcard              Allow wildcard syntax for symbol-related flags. Incompatible with --regex. Allows using '*' to match any number of characters, '?' to match any single character, '' to escape special characters, and '[]' to define character classes. Wildcards beginning with '!' will prevent a match, for example "-N '*' -N '!x'" will strip all symbols except for "x".
  -W <value>              Alias for --weaken-symbol
  -w                      Alias for --wildcard
  -X                      Alias for --discard-locals
  -x                      Alias for --discard-all

OPTIONS (COFF specific):
  --subsystem=name[:version]
   Set the PE subsystem, and optionally subsystem version

OPTIONS (Mach-O specific):
  --keep-undefined Do not remove undefined symbols

Pass @FILE as argument to read options from FILE.
Options (96)
OptionDescriptionSource
--add-gnu-debuglink debug-fileAdd a .gnu_debuglink for <debug-file>help
--add-section section=fileAdd a section named <section> with the contents of <file>help
--add-symbol name=[section:]valueAdd new symbol <name> to .symtab.help
--adjust-section-vma valueAlias for --change-section-addresshelp
--adjust-start valueAlias for --change-starthelp
--allow-broken-linksAllow the tool to remove sections even if it would leave invalid section references.help
--binary-architecture valueIgnored for compatibilityhelp
-B valueAlias for --binary-architecturehelp
--change-section-address sectionpattern{=|+|-}valSet the address of the <section> to, or adjust it by, <val>help
--change-section-lma *{+|-}valShift LMA of non-zero-sized sections in the program header by <val>help
--change-start incrAdd <incr> to the start address.help
--compress-debug-sections formatCompress DWARF debug sections using specified format.help
--compress-sections section-glob>=<formatCompress or decompress sections using specified format.help
--decompress-debug-sectionsDecompress DWARF debug sectionshelp
--disable-deterministic-archivesDisable deterministic mode when operating on archives (use real values for UIDs, GIDs, and timestamps).help
--discard-allRemove most local symbols.help
--discard-localsRemove local symbols starting with .Lhelp
--dump-section section=fileDump contents of section named <section> into file <file>help
-DAlias for --enable-deterministic-archiveshelp
--enable-deterministic-archivesEnable deterministic mode when operating on archives (use zero for UIDs, GIDs, and timestamps).help
--extract-dwoRemove all sections that are not DWARF .dwo sections from filehelp
--extract-main-partitionExtract main partition from the input filehelp
--extract-partition nameExtract named partition from input filehelp
-F valueAlias for --targethelp
--gap-fill valueFill the gaps between sections with <value> instead of zero.help
--globalize-symbol symbolMark <symbol> as globalhelp
--globalize-symbols filenameRead a list of symbols from <filename> and mark defined symbols with those names as globalhelp
-G valueAlias for --keep-global-symbolhelp
-gAlias for --strip-debughelp
--input-target formatRead the input as the specified formathelp
-I valueAlias for --input-targethelp
-j valueAlias for --only-sectionhelp
--keep-file-symbolsKeep symbols of type STT_FILE, even if they would otherwise be strippedhelp
--keep-global-symbol symbolMark all symbols local, except for symbols with the name <symbol>.help
--keep-global-symbols filenameRead a list of symbols from <filename> and run as if --keep-global-symbol=<symbol> is set for each one.help
--keep-section sectionKeep <section>help
--keep-symbol symbolWhen removing symbols, do not remove <symbol>help
-K valueAlias for --keep-symbolhelp
--localize-hiddenMark all symbols that have hidden or internal visibility as localhelp
--localize-symbol symbolMark any defined non-common symbol named <symbol> as localhelp
--localize-symbols filenameRead a list of names from <filename> and mark any defined non-common symbols with those names as localhelp
-L valueAlias for --localize-symbolhelp
--new-symbol-visibility valueSpecify the visibility of symbols automatically created when using binary input or --add-symbol.help
--no-verify-note-sectionsDon't validate note sectionshelp
-N valueAlias for --strip-symbolhelp
--only-keep-debugProduce a debug file as the output that only preserves contents of sections useful for debugging purposeshelp
--only-section sectionRemove all but <section>help
--output-target formatWrite the output as the specified formathelp
-O valueAlias for --output-targethelp
--pad-to addressPad the output up to the load address <address>, using a value of zero or the value specified by the --gap-fill option.help
--prefix-alloc-sections prefixAdd <prefix> to the start of every allocated section namehelp
--preserve-datesPreserve access and modification timestampshelp
-pAlias for --preserve-dateshelp
--redefine-sym old=newChange the name of a symbol old to newhelp
--redefine-syms filenameRead a list of symbol pairs from <filename> and run as if --redefine-sym=<old>=<new> is set for each one.help
--regexPermit regular expressions in name comparisonhelp
--remove-note name/]type_idRemove note(s) with <type_id> and optional <name>help
--remove-section sectionRemove <section>help
--remove-symbol-prefix prefixRemove <prefix> from the start of every symbol name.help
--rename-section old=newRename sections called <old> to <new>, and apply any specified <flag> values.help
-R valueAlias for --remove-sectionhelp
--set-section-alignment section=alignSet alignment for a given sectionhelp
--set-section-flags section=flag1Set section properties based on the specified <flags>.help
--set-section-type section=typeSet the type of section <section> to the integer <type>help
--set-start addrSet the start address to <addr>.help
--set-symbol-visibility symbol=visibilityChange the visibility of a symbol to the specified valuehelp
--set-symbols-visibility filename=visibilityRead a list of symbols from <filename> and change their visibility to the specified value.help
--skip-symbol symbolDo not change parameters of symbol <symbol> when executing other options that can change the symbol's name, binding or visibilityhelp
--split-dwo dwo-fileEquivalent to --extract-dwo and <dwo-file> as the output file and no other options, and then --strip-dwo on the input filehelp
--strip-all-gnuRemove all symbols, debug sections and relocations.help
--strip-allFor ELF, remove all symbols and non-alloc sections not within segments, except for .gnu.warning*, .ARM.attribute, and the section name table.help
--strip-debugRemove all debug sectionshelp
--strip-dwoRemove all DWARF .dwo sectionshelp
--strip-non-allocRemove all non-allocated sections that are not within segmentshelp
--strip-sectionsRemove all section headers and all section data not within segmentshelp
--strip-symbol symbolStrip <symbol>help
--strip-symbols filenameRemove all symbols whose names appear in the file <filename>help
--strip-unneeded-symbol symbolRemove all symbols named <symbol> that are local or undefined and are not required by any relocationhelp
--strip-unneeded-symbols filenameRemove all symbols whose names appear in the file <file>, if they are local or undefined and are not required by any relocationhelp
--strip-unneededRemove all symbols not needed by relocationshelp
-SAlias for --strip-allhelp
--target valueEquivalent to --input-target and --output-target for the specified formathelp
--update-section name=fileReplace the contents of section <name> with contents from a file <file>help
-UAlias for --disable-deterministic-archiveshelp
--verify-note-sectionsValidate note sectionshelp
--versionPrint the version and exit.help
-VAlias for --versionhelp
--weaken-symbol symbolMark global symbols named <symbol> as weakhelp
--weaken-symbols filenameRead a list of symbols from <filename> and mark global symbols with those names as weakhelp
--weakenMark all defined global symbols as weakhelp
--wildcardAllow wildcard syntax for symbol-related flags.help
-W valueAlias for --weaken-symbolhelp
-wAlias for --wildcardhelp
-XAlias for --discard-localshelp
-xAlias for --discard-allhelp
--subsystem name[:versionSet the PE subsystem, and optionally subsystem versionhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.