OBJCOPY(1) GNU Development Tools OBJCOPY(1) (NAME) objcopy - (SYNOPSIS) objcopy [-F bfdname|--target=bfdname] [-I bfdname|--input-target=bfdname] [-O bfdname|--output-target=bfdname] [-B bfdarch|--binary-architecture=bfdarch] [-S|--strip-all] [-g|--strip-debug] [--strip-unneeded] [-K symbolname|--keep-symbol=symbolname] [--keep-file-symbols] [--keep-section-symbols] [-N symbolname|--strip-symbol=symbolname] [--strip-unneeded-symbol=symbolname] [-G symbolname|--keep-global-symbol=symbolname] [--localize-hidden] [-L symbolname|--localize-symbol=symbolname] [--globalize-symbol=symbolname] [--globalize-symbols=filename] [-W symbolname|--weaken-symbol=symbolname] [-w|--wildcard] [-x|--discard-all] [-X|--discard-locals] [-b byte|--byte=byte] [-i [breadth]|--interleave[=breadth]] [--interleave-width=width] [-j sectionpattern|--only-section=sectionpattern] [-R sectionpattern|--remove-section=sectionpattern] [--keep-section=sectionpattern] [--remove-relocations=sectionpattern] [--strip-section-headers] [-p|--preserve-dates] [-D|--enable-deterministic-archives] [-U|--disable-deterministic-archives] [--debugging] [--gap-fill=val] [--pad-to=address] [--set-start=val] [--adjust-start=incr] [--change-addresses=incr] [--change-section-address sectionpattern{=,+,-}val] [--change-section-lma sectionpattern{=,+,-}val] [--change-section-vma sectionpattern{=,+,-}val] [--change-warnings] [--no-change-warnings] [--set-section-flags sectionpattern=flags] [--set-section-alignment sectionpattern=align] [--add-section sectionname=filename] [--dump-section sectionname=filename] [--update-section sectionname=filename] [--rename-section oldname=newname[,flags]] [--long-section-names {enable,disable,keep}] [--change-leading-char] [--remove-leading-char] [--reverse-bytes=num] [--srec-len=ival] [--srec-forceS3] [--redefine-sym old=new] [--redefine-syms=filename] [--weaken] [--keep-symbols=filename] [--strip-symbols=filename] [--strip-unneeded-symbols=filename] [--keep-global-symbols=filename] [--localize-symbols=filename] [--weaken-symbols=filename] [--add-symbol name=[section:]value[,flags]] [--alt-machine-code=index] [--prefix-symbols=string] [--prefix-sections=string] [--prefix-alloc-sections=string] [--add-gnu-debuglink=path-to-file] [--only-keep-debug] [--strip-dwo] [--extract-dwo] [--extract-symbol] [--writable-text] [--readonly-text] [--pure] [--impure] [--file-alignment=num] [--heap=reserve[,commit]] [--image-base=address] [--section-alignment=num] [--stack=reserve[,commit]] [--subsystem=which:major.minor] [--compress-debug-sections] [--decompress-debug-sections] [--elf-stt-common=val] [--merge-notes] [--no-merge-notes] [--verilog-data-width=val] [-v|--verbose] [-V|--version] [--help] [--info] infile [outfile].SH " (DESCRIPTION)" GNU objcopy (object file) . objcopy GNU BFD . . objcopy . objcopy (fully linked) . (relocatable) . objcopy . objcopy BFD BFD . objcopy srec S-record ( -O srec). objcopy binary ( -O binary). objcopy (memory dump) . (symbols) (relocation) . . S-record -S (debugging) . -R . ---objcopy (endianness) . ( ) objcopy ( srec). ( --reverse-bytes .) (OPTIONS) infile outfile . outfile objcopy infile . -I bfdname --input-target=bfdname bfdname . -O bfdname --output-target=bfdname bfdname . -F bfdname --target=bfdname bfdname . -B bfdarch --binary-architecture=bfdarch . bfdarch . bfdarch . . _binary_objfile_start _binary_objfile_end _binary_objfile_size . -j sectionpattern --only-section=sectionpattern . . . (wildcard) sectionpattern . sectionpattern (!) --only-section . : --only-section=.text.* --only-section=!.text.foo '.text.*' '.text.foo' . -R sectionpattern --remove-section=sectionpattern sectionpattern . . . (wildcard) sectionpattern . -j -R . sectionpattern (!) --remove-section . : --remove-section=.text.* --remove-section=!.text.foo '.text.*' '.text.foo' . --keep-section=sectionpattern sectionpattern . --remove-relocations=sectionpattern (non-dynamic relocations) sectionpattern . . .rela.plt --remove-relocations=.plt . (wildcard) sectionpattern . : --remove-relocations=.text.* '.text.*' . sectionpattern (!) --remove-relocations . : --remove-relocations=.text.* --remove-relocations=!.text.foo '.text.*' '.text.foo' . --strip-section-headers . ELF . --strip-all --merge-notes . -S --strip-all . (debug) ..IP -g 4 --strip-debug . --strip-unneeded --strip-debug (relocation) . -K symbolname --keep-symbol=symbolname symbolname . . -N symbolname --strip-symbol=symbolname symbolname . . --strip-unneeded-symbol=symbolname symbolname . . -G symbolname --keep-global-symbol=symbolname symbolname . . . : --globalize-symbol --globalize-symbols . --localize-hidden ELF (hidden) (internal) . -L . -L symbolname --localize-symbol=symbolname (weak) symbolname . . - (unique) . -W symbolname --weaken-symbol=symbolname symbolname . . --globalize-symbol=symbolname symbolname . . : -G --keep-global-symbol . -w --wildcard symbolname . (?) (*) (\) ([]) . (!) . : -w -W !foo -W fo* objcopy "fo" "foo" . -x --discard-all . -X --discard-locals . ( L . .) -b byte --byte=byte --interleave byte . byte 0 breadth-1 breadth --interleave . -i [breadth] --interleave[=breadth] breadth . ( ). --byte . --interleave-width . ROM . "srec" . --byte objcopy . 4 --byte 0 objcopy . --interleave-width=width --interleave width . --byte --interleave . 1 . width byte --byte --interleave . -b 0 -i 4 --interleave-width=2 -b 2 -i 4 --interleave-width=2 objcopy 16 32 . '12345678' '1256' '3478' . -p --preserve-dates . PE SOURCE_DATE_EPOCH . (Unix epoch) . -D --enable-deterministic-archives deterministic () . UID GID (file modes) . binutils --enable-deterministic-archives . -U . -U --disable-deterministic-archives deterministic . -D : UID GID . binutils --enable-deterministic-archives . --debugging . . --gap-fill val val. (LMA) . val . --pad-to address () address. . --gap-fill ( ) . --set-start val ( entry address) val. . --change-start incr --adjust-start incr ( ) incr . . --change-addresses incr --adjust-vma incr VMA LMA incr . . (relocate) . --change-section-address sectionpattern{=,+,-}val --adjust-section-vma sectionpattern{=,+,-}val VMA LMA sectionpattern . = val . val . --change-addresses . sectionpattern --no-change-warnings . --change-section-lma sectionpattern{=,+,-}val LMA sectionpattern . LMA . VMA ROM . = val . val . --change-addresses . sectionpattern --no-change-warnings . --change-section-vma sectionpattern{=,+,-}val VMA sectionpattern . VMA . LMA ROM . = val . val . --change-addresses . sectionpattern --no-change-warnings . - VMA (fully linked) . --change-warnings --adjust-warnings --change-section-address --change-section-lma --change-section-vma . . --no-change-warnings --no-adjust-warnings --change-section-address --adjust-section-lma --adjust-section-vma . --set-section-flags sectionpattern=flags sectionpattern . flags . : alloc contents load noload readonly code data rom exclude share debug large. contents contents -- . share COFF ELF. ELF x86-64 large SHF_X86_64_LARGE . --set-section-alignment sectionpattern=align sectionpattern . align . - LMA VMA . --change-section-lma / --change-section-vma . VMA . --add-section sectionname=filename sectionname . filename . . . - --set-section-flags . --dump-section sectionname=filename sectionname filename . --add-section . --only-section . . --update-section sectionname=filename sectionname filename. . sectionname . ELF (segment) --remove-section --add-section . . - --rename-section --update-section . --update-section --rename-section . --add-symbol name=[section:]value[,flags] name . . section ABS . . . . (global) . 'before=othersym' othersym () ..IP "--rename-section oldname=newname[,flags]" 4 oldname newname flags . (linker script) (object file) . --set-section-flags . (binary) .data . .rodata : objcopy -I binary -O -B \ --rename-section .data=.rodata,alloc,load,readonly,data,contents \ --long-section-names {enable,disable,keep} "COFF" "PE-COFF" . keep . enable disable disable (truncate) . enable keep enable . --change-leading-char . (_) . objcopy . . . --remove-leading-char (global) . . . . --change-leading-char . --reverse-bytes=num . . (interleaving) . ROM . ROM CPU (little-endian) . (endianness) ROM . : 12345678. --reverse-bytes=2 21436587 . --reverse-bytes=4 43218765 . --reverse-bytes=2 --reverse-bytes=4 34127856 . --srec-len=ival srec . S ( Srecords) ival . crc . --srec-forceS3 srec . S1/S2 S3 . --redefine-sym old=new old new . . --redefine-syms=filename --redefine-sym <> filename . filename (flat file) . (#) . . --weaken (global) (weak) . -R . . --keep-symbols=filename --keep-symbol filename . filename . . . --strip-symbols=filename --strip-symbol filename . filename . . . --strip-unneeded-symbols=filename --strip-unneeded-symbol filename . filename . . . --keep-global-symbols=filename --keep-global-symbol filename . filename . . . --localize-symbols=filename --localize-symbol filename . filename . . . --globalize-symbols=filename --globalize-symbol filename . filename . . . : -G --keep-global-symbol . --weaken-symbols=filename --weaken-symbol filename . filename . . . --alt-machine-code=index index . (toolchain) . ELF index e_machine ELF . --writable-text (text) . . --readonly-text (text) () . . --pure (demand paged) . . --impure impure ( ) . . --prefix-symbols=string string . --prefix-sections=string string . --prefix-alloc-sections=string string (allocated sections) ..IP --add-gnu-debuglink=path-to-file 4 .gnu_debuglink path-to-file . : path-to-file . .gnu_debuglink (checksum) . . --add-gnu-debuglink . --add-gnu-debuglink : objcopy --add-gnu-debuglink=foo.debug . : "* ." "* " .debug "* /usr/lib/debug." . --keep-section-symbols (strip ) --strip-debug --strip-unneeded . --keep-file-symbols --strip-debug --strip-unneeded . --only-keep-debug --strip-debug . ELF note . - . debuginfo (relocate) . --add-gnu-debuglink . RAM . : 1.< . > "foo" ... 1.< "objcopy --only-keep-debug foo foo.dbg" > . 1.< "objcopy --strip-debug foo" > . 1.< "objcopy --add-gnu-debuglink=foo.dbg foo" > . --- ".dbg" . "--only-keep-debug" . : 1.< .> 1.<"foo" "foo.full" > 1.< "objcopy --strip-debug foo" > 1.< "objcopy --add-gnu-debuglink=foo.full foo" > --add-gnu-debuglink --only-keep-debug . --- (fully linked) . (object files) . gnu_debuglink . --strip-dwo DWARF .dwo . -gsplit-dwarf .o .dwo . --extract-dwo .dwo .dwo --strip-dwo .o . --extract-dwo DWARF .dwo . --strip-dwo . --file-alignment num (file alignment) . . 512 . [ PE .] --heap reserve --heap reserve,commit ( /commit) (heap) . [ PE .] --image-base value value dll . dll . (relocate) dll dll . 0x400000 0x10000000 dll . [ PE .] --section-alignment num [ PE .] PE ( ) . . 0x1000 . - LMA VMA --set-section-lma --set-section-vma . LMA VMA . --stack reserve --stack reserve,commit ( /commit) (stack) . [ PE .].IP "--subsystem which" 4 --subsystem which:major --subsystem which:major.minor . which "native" "windows" "console" "posix" "efi-app" "efi-bsd" "efi-rtd" "sal-rtd" "xbox". . which . [ PE .] --extract-symbol . : *< > *< > *< .> .sym VxWorks . --just-symbols . --compress-debug-sections DWARF zlib SHF_COMPRESSED ELF ABI . - . --compress-debug-sections=none --compress-debug-sections=zlib --compress-debug-sections=zlib-gnu --compress-debug-sections=zlib-gabi --compress-debug-sections=zstd ELF DWARF . --compress-debug-sections=none --decompress-debug-sections . --compress-debug-sections=zlib --compress-debug-sections=zlib-gabi --compress-debug-sections . --compress-debug-sections=zlib-gnu DWARF zlib-gnu . .zdebug . --compress-debug-sections=zstd DWARF zstd . - . --decompress-debug-sections DWARF . .zdebug . --elf-stt-common=yes --elf-stt-common=no ELF (common) "STT_COMMON" "STT_OBJECT" . --elf-stt-common=yes "STT_COMMON" . --elf-stt-common=no "STT_OBJECT" . --merge-notes --no-merge-notes ELF ( ) SHT_NOTE . -V --version objcopy . --verilog-data-width=bytes Verilog . (endianness) . -v --verbose : (object) . objcopy -V . --help objcopy . --info . @file file . @file . file . file (whitespace) . . ( ) . file @file ..SH " (SEE ALSO)" ld(1) objdump(1) Info binutils. (COPYRIGHT) (c) 1991-2025 Free Software Foundation, Inc. / << >> (GNU Free Documentation License) 1.3 Free Software Foundation (Invariant Sections) (Front-Cover Texts) (Back-Cover Texts) . "GNU Free Documentation License" . binutils-2.45.1 2026-01-23 OBJCOPY(1)