OVERVIEW: llvm-objcopy tool USAGE: llvm-objcopy [options] input [output] OPTIONS: --add-gnu-debuglink=debug-file Add a .gnu_debuglink for --add-section=section=file Add a section named
with the contents of --add-symbol=name=[section:]value[,flags] Add new symbol 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 Alias for --change-section-address --adjust-start 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= Ignored for compatibility -B Alias for --binary-architecture --change-section-address=sectionpattern{=|+|-}val Set the address of the
to, or adjust it by, --change-section-lma=*{+|-}val Shift LMA of non-zero-sized sections in the program header by --change-start=incr Add 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 is omitted --compress-sections== 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
into 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 --extract-section=section=file Extract section named
into standalone object in file -F Alias for --target --gap-fill=value Fill the gaps between sections with instead of zero. must be an unsigned 8-bit integer. This option is only supported for ELF input and binary output --globalize-symbol=symbol Mark as global --globalize-symbols=filename Read a list of symbols from and mark defined symbols with those names as global -G Alias for --keep-global-symbol -g Alias for --strip-debug --input-target=format Read the input as the specified format -I Alias for --input-target -j 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 . Can be specified multiple times to ignore multiple symbols --keep-global-symbols=filename Read a list of symbols from and run as if --keep-global-symbol= is set for each one. 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
--keep-symbol=symbol When removing symbols, do not remove --keep-symbols=filename Read a list of symbols from and run as if --keep-symbol= is set for each one. 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 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 as local --localize-symbols=filename Read a list of names from and mark any defined non-common symbols with those names as local -L Alias for --localize-symbol --new-symbol-visibility= 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 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
--output-target=format Write the output as the specified format -O Alias for --output-target --pad-to=address Pad the output up to the load 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 to the start of every allocated section name --prefix-symbols=prefix Add 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 and run as if --redefine-sym== is set for each one. 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 and optional --remove-section=section Remove
--remove-symbol-prefix=prefix Remove from the start of every symbol name. No-op for symbols that do not start with --rename-section=old=new[,flag1,...] Rename sections called to , and apply any specified values. See --set-section-flags for a list of supported flags -R 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 . 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
to the integer --set-start=addr Set the start address to . 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 and change their visibility to the specified value. Visibility values: default, internal, hidden, protected --skip-symbol=symbol Do not change parameters of symbol when executing other options that can change the symbol's name, binding or visibility --skip-symbols=filename Read a list of symbols from and run as if --skip-symbol= is set for each one. 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 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 --strip-symbols=filename Remove all symbols whose names appear in the file --strip-unneeded-symbol=symbol Remove all symbols named 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 , 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= Equivalent to --input-target and --output-target for the specified format --update-section=name=file Replace the contents of section with contents from a 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 as weak --weaken-symbols=filename Read a list of symbols from 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 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.