OBJCOPY(1) OBJCOPY(1) objcopy - objcopy [-F _bfd|--target=_bfd] [-I _bfd|--input-target=_bfd] [-O _bfd|--output-target=_bfd] [-B _bfd|--binary-architecture=_bfd] [-S|--strip-all] [-g|--strip-debug] [--strip-unneeded] [-K _|--keep-symbol=_] [--keep-file-symbols] [--keep-section-symbols] [-N _|--strip-symbol=_] [--strip-unneeded-symbol=_] [-G _|--keep-global-symbol=_] [--localize-hidden] [-L _|--localize-symbol=_] [--globalize-symbol=_] [--globalize-symbols=_] [-W _|--weaken-symbol=_] [-w|--wildcard] [-x|--discard-all] [-X|--discard-locals] [-b |--byte=] [-i []|--interleave[=]] [--interleave-width=] [-j _|--only-section=_] [-R _|--remove-section=_] [--keep-section=_] [--remove-relocations=_] [--strip-section-headers] [-p|--preserve-dates] [-D|--enable-deterministic-archives] [-U|--disable-deterministic-archives] [--debugging] [--gap-fill=] [--pad-to=] [--set-start=] [--adjust-start=] [--change-addresses=] [--change-section-address _{=,+,-}] [--change-section-lma _{=,+,-}] [--change-section-vma _{=,+,-}] [--change-warnings] [--no-change-warnings] [--set-section-flags _=] [--set-section-alignment _=] [--add-section _=_] [--dump-section _=_] [--update-section _=_] [--rename-section _=_[,]] [--long-section-names {enable,disable,keep}] [--change-leading-char] [--remove-leading-char] [--reverse-bytes=] [--srec-len=_] [--srec-forceS3] [--redefine-sym =] [--redefine-syms=_] [--weaken] [--keep-symbols=_] [--strip-symbols=_] [--strip-unneeded-symbols=_] [--keep-global-symbols=_] [--localize-symbols=_] [--weaken-symbols=_] [--binary-symbol-prefix] [--add-symbol =[:][,]] [--alt-machine-code=] [--prefix-symbols=] [--prefix-sections=] [--prefix-alloc-sections=] [--add-gnu-debuglink=__] [--only-keep-debug] [--strip-dwo] [--extract-dwo] [--extract-symbol] [--writable-text] [--readonly-text] [--pure] [--impure] [--file-alignment=] [--heap=[,]] [--image-base=] [--section-alignment=] [--stack=[,]] [--subsystem=:.] [--compress-debug-sections] [--decompress-debug-sections] [--elf-stt-common=] [--merge-notes] [--no-merge-notes] [--verilog-data-width=] [-v|--verbose] [-V|--version] [--help] [--info] _ [_] GNU objcopy . objcopy GNU BFD . . objcopy . objcopy . . objcopy . objcopy BFD BFD . objcopy -S srec ( -O srec). objcopy binary ( -O binary). objcopy . . . -S -S . -R . --- objcopy (endianness) . ( ) objcopy ( srec). ( --reverse-bytes.) _ _ . _ objcopy _. -I _bfd --input-target=bfdname _bfd . -O _bfd --output-target=_bfd _bfd. -F _bfd --target=_bfd _bfd . -B _bfd --binary-architecture=_bfd . _bfd. _bfd . . _binary_objfile_start _binary_objfile_end _binary_objfile_size. . -j _ --only-section=_ . . . _. _ (!) --only-section . : --only-section=.text.* --only-section=!.text.foo '.text.*' '.text.foo'. -R _ --remove-section=_ _ . . . _. -j -R . sectionpattern (!) --remove-section . : --remove-section=.text.* --remove-section=!.text.foo '.text.*' '.text.foo'. --keep-section=sectionpattern sectionpattern. --remove-relocations=_ _. . .rela.plt --remove-relocations=.plt . _. : --remove-relocations=.text.* '.text.*'. sectionpattern (!) (relocation) --remove-relocations . : --remove-relocations=.text.* --remove-relocations=!.text.foo '.text.*' '.text.foo'. --strip-section-headers ELF. --strip-all --merge-notes. -S --strip-all . . -g --strip-debug . --strip-unneeded --strip-debug. -K _ --keep-symbol=symbolname symbolname . . -N _ --strip-symbol=_ _ . . --strip-unneeded-symbol=_ symbolname (relocation). . -G symbolname --keep-global-symbol=symbolname symbolname . . . : --globalize-symbol --globalize-symbols. --localize-hidden ELF . -L. -L symbolname --localize-symbol=symbolname symbolname . . - . -W symbolname --weaken-symbol=symbolname symbolname . . --binary-symbol-prefix=string --input-target=binary string . : _start _end _size (mangled) _binary. . --globalize-symbol=symbolname symbolname . . : -G --keep-global-symbol. -w --wildcard symbolnames . (?) (*) (\) ([]) . (!) . : -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". objcopy --byte . 4 --byte 0 objcopy . --interleave-width=width --interleave width . --byte --interleave. 1. width byte --byte --interleave. (flashes) 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 . . -D --enable-deterministic-archives (deterministic). UIDs GIDs . binutils --enable-deterministic-archives . -U . -U --disable-deterministic-archives . -D : UID GID . binutils --enable-deterministic-archives. --debugging . . --gap-fill val val. (LMA) . val. --pad-to address address. . --gap-fill ( ). --set-start val ( ) val. . --change-start incr --adjust-start incr ( ) incr. . --change-addresses incr --adjust-vma incr VMA LMA incr. . . --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 sectionpattern. align 1 2 4 8.... - 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 . (linker script) . --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 . enable keep enable . --change-leading-char . . objcopy . . . --remove-leading-char . . . . --change-leading-char . --reverse-bytes=num . . . ROM . 32 ROM 8 (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 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 . . --readonly-text . . --pure . . --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 . . --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 . - . . --add-gnu-debuglink . . : 1. . "foo" ... 2. "objcopy --only-keep-debug foo foo.dbg" . 3. "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 --heap , ( ) . [ PE.] --image-base value value dll. dll. dll dlls . 0x400000 0x10000000 dll. [ PE.] --section-alignment num [ PE.] PE - . . 0x1000. - LMA VMA --set-section-lma --set-section-vma . LMA VMA . --stack --stack , ( ) . [ PE.] --subsystem --subsystem : --subsystem :. . "native" "windows" "console" "posix" "efi-app" "efi-bsd" "efi-rtd" "sal-rtd" "xbox". . . [ 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= Verilog . (endianness) . -v --verbose : . objcopy -V . --help objcopy. --info . @ file. @file . file . file . . ( ) . file @file . ld(1) objdump(1) Info binutils. (c) 1991-2026 . / (GNU Free Documentation License) 1.3 . "GNU Free Documentation License". 3 . . : . binutils-2.46 9 2026 OBJCOPY(1)