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] [--binary-symbol-prefixstring] [--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] (DESCRIPTION) objcopy (Object File) . objcopy BFD (GNU BFD Library) . objcopy . objcopy (Fully Linked) (Relocatable) . objcopy . objcopy BFD BFD . objcopy (S-records) srec ( -O srec). objcopy binary ( -O binary). objcopy (Memory Dump) . . -S . -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 . . . _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 . . . 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 . sectionpattern . : --remove-relocations=.text.* '.text.*' . sectionpattern (!) --remove-relocations . : --remove-relocations=.text.* --remove-relocations=!.text.foo '.text.*' '.text.foo' . --strip-section-headers (Section Headers) . ELF --strip-all --merge-notes . -S --strip-all . . -g --strip-debug . --strip-unneeded --strip-debug . -K symbolname --keep-symbol=symbolname symbolname . . -N symbolname --strip-symbol=symbolname symbolname . . --strip-unneeded-symbol=symbolname symbolname (relocation) . . -G symbolname --keep-global-symbol=symbolname symbolname (global) . . . : --globalize-symbol --globalize-symbols . --localize-hidden ELF (hidden) (internal) . -L . -L symbolname --localize-symbol=symbolname (weak) symbolname . . : (unique) . -W symbolname --weaken-symbol=symbolname symbolname (weak) . . --binary-symbol-prefix=string --input-target=binary string . : _start _end _size (mangled) _binary . . --globalize-symbol=symbolname symbolname (global) . . : -G --keep-global-symbol . -w --wildcard (regular expressions) symbolname . () (*) (\) ([]) . (!) . : -w -W !foo -W fo* objcopy "fo" "foo" . -x --discard-all . -X --discard-locals . ( L . .) -b byte --byte=byte (interleaving) --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 . (image) 16 32 -b 0 -i 4 --interleave-width=2 -b 2 -i 4 --interleave-width=2 objcopy . '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 (debugging) . . --gap-fill val (sections) val . (LMA) . val . --pad-to address address (pad) . . --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 . --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 . large ELF x86-64 SHF_X86_64_LARGE . --set-section-alignment sectionpattern=align (Alignment) 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 () . . . . . 'before=othersym' othersym () . --rename-section oldname=newname[,flags] oldname newname flags . . --set-section-flags . .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 . (_) . . . --change-leading-char . --reverse-bytes=num . . (interleaving) . ROM . ROM (little-endian) . 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 "old new" filename . filename . (#) . . --weaken (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 . . 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 . --add-gnu-debuglink=path-to-file .gnu_debuglink path-to-file . : path-to-file . .gnu_debuglink (checksum) . . --add-gnu-debuglink . --add-gnu-debuglink : objcopy --add-gnu-debuglink=foo.debug . : o . o .debug. o /usr/lib/debug. . --keep-section-symbols --strip-debug --strip-unneeded . --keep-file-symbols --strip-debug --strip-unneeded . --only-keep-debug --strip-debug . ELF (note sections) . - . debuginfo . --add-gnu-debuglink : RAM . : 1. . "foo" ... 2. "objcopy --only-keep-debug foo foo.dbg" . 3. (stripped) "objcopy --strip-debug foo" . 4. "objcopy --add-gnu-debuglink=foo.dbg foo" . --- ".dbg" . "--only-keep-debug" . : 1. . 2. "foo" "foo.full" . 3. "objcopy --strip-debug foo" . 4. "objcopy --add-gnu-debuglink=foo.full foo" . --add-gnu-debuglink . --only-keep-debug . --- . . 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 . . 512 . [ PE .] --heap reserve --heap reserve,commit ( /commit) (heap) . [ PE .] --image-base value value dll . dll . dll dll . 0x400000 dll 0x10000000 . [ 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 .] --subsystem which --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 . : o . o . o . .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 "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 : . objcopy -V . --help objcopy . --info . @file file . @file . file . file . . ( ) . file @file . (SEE ALSO) ld(1) objdump(1) Info binutils. (COPYRIGHT) (c) 1991-2026 Free Software Foundation, Inc. / (GNU Free Documentation License) . . "GNU Free Documentation License" . binutils-2.47 2026-07-30 OBJCOPY(1)