[@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}]
[@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}]
[@option{-B} @var{bfdarch}|@option{--binary-architecture=}@var{bfdarch}]
- [@option{-S}|@option{--strip-all}] [@option{-g}|@option{--strip-debug}]
+ [@option{-S}|@option{--strip-all}]
+ [@option{-g}|@option{--strip-debug}]
[@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}]
[@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}]
[@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}]
[@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}]
[@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}]
- [@option{-x}|@option{--discard-all}] [@option{-X}|@option{--discard-locals}]
+ [@option{-x}|@option{--discard-all}]
+ [@option{-X}|@option{--discard-locals}]
[@option{-b} @var{byte}|@option{--byte=}@var{byte}]
[@option{-i} @var{interleave}|@option{--interleave=}@var{interleave}]
[@option{-j} @var{sectionname}|@option{--only-section=}@var{sectionname}]
[@option{-R} @var{sectionname}|@option{--remove-section=}@var{sectionname}]
[@option{-p}|@option{--preserve-dates}]
[@option{--debugging}]
- [@option{--gap-fill=}@var{val}] [@option{--pad-to=}@var{address}]
- [@option{--set-start=}@var{val}] [@option{--adjust-start=}@var{incr}]
+ [@option{--gap-fill=}@var{val}]
+ [@option{--pad-to=}@var{address}]
+ [@option{--set-start=}@var{val}]
+ [@option{--adjust-start=}@var{incr}]
[@option{--change-addresses=}@var{incr}]
[@option{--change-section-address} @var{section}@{=,+,-@}@var{val}]
[@option{--change-section-lma} @var{section}@{=,+,-@}@var{val}]
[@option{--set-section-flags} @var{section}=@var{flags}]
[@option{--add-section} @var{sectionname}=@var{filename}]
[@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]]
- [@option{--change-leading-char} ] [@option{--remove-leading-char}]
- [@option{--srec-len=}@var{ival} ] [@option{--srec-forceS3}]
- [@option{--redefine-sym} @var{old}=@var{new} ]
+ [@option{--change-leading-char}] [@option{--remove-leading-char}]
+ [@option{--srec-len=}@var{ival}] [@option{--srec-forceS3}]
+ [@option{--redefine-sym} @var{old}=@var{new}]
+ [@option{--redefine-syms=}@var{filename}]
[@option{--weaken}]
[@option{--keep-symbols=}@var{filename}]
[@option{--strip-symbols=}@var{filename}]
[@option{--prefix-symbols=}@var{string}]
[@option{--prefix-sections=}@var{string}]
[@option{--prefix-alloc-sections=}@var{string}]
+ [@option{--add-gnu-debuglink=}@var{path-to-file}]
+ [@option{--only-keep-debug}]
[@option{-v}|@option{--verbose}]
[@option{-V}|@option{--version}]
[@option{--help}] [@option{--info}]
@item -g
@itemx --strip-debug
-Do not copy debugging symbols from the source file.
+Do not copy debugging symbols or sections from the source file.
@item --strip-unneeded
Strip all symbols that are not needed for relocation processing.
when one is trying link two things together for which you have no
source, and there are name collisions.
+@item --redefine-syms=@var{filename}
+Apply @option{--redefine-sym} to each symbol pair "@var{old} @var{new}"
+listed in the file @var{filename}. @var{filename} is simply a flat file,
+with one symbol pair per line. Line comments may be introduced by the hash
+character. This option may be given more than once.
+
@item --weaken
Change all global symbols in the file to be weak. This can be useful
when building an object which will be linked against other objects using
Prefix all the names of all allocated sections in the output file with
@var{string}.
+@item --add-gnu-debuglink=@var{path-to-file}
+Creates a .gnu_debuglink section which contains a reference to @var{path-to-file}
+and adds it to the output file.
+
+@item --only-keep-debug
+Strip a file, removing any sections that would be stripped by
+@option{--strip-debug} and leaving the debugging sections.
+
+The intention is that this option will be used in conjunction with
+@option{--add-gnu-debuglink} to create a two part executable. One a
+stripped binary which will occupy less space in RAM and in a
+distribution and the second a debugging information file which is only
+needed if debugging abilities are required. The suggested procedure
+to create these files is as follows:
+
+@enumerate
+@item Link the executable as normal. Assuming that is is called
+@code{foo} then...
+@item Run @code{objcopy --only-keep-debug foo foo.dbg} to
+create a file containing the debugging info.
+@item Run @code{objcopy --strip-debug foo} to create a
+stripped executable.
+@item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo}
+to add a link to the debugging info into the stripped executable.
+@end enumerate
+
+Note - the choice of @code{.dbg} as an extension for the debug info
+file is arbitrary. Also the @code{--only-keep-debug} step is
+optional. You could instead do this:
+
+@enumerate
+@item Link the executable as normal.
+@item Copy @code{foo} to @code{foo.full}
+@item Run @code{objcopy --strip-debug foo}
+@item Run @code{objcopy --add-gnu-debuglink=foo.full foo}
+@end enumerate
+
+ie the file pointed to by the @option{--add-gnu-debuglink} can be the
+full executable. It does not have to be a file created by the
+@option{--only-keep-debug} switch.
+
@item -V
@itemx --version
Show the version number of @command{objcopy}.
Display debugging information. This attempts to parse debugging
information stored in the file and print it out using a C like syntax.
Only certain types of debugging information have been implemented.
+Some other types are supported by @command{readelf -w}.
+@xref{readelf}.
@item -d
@itemx --disassemble
@item -M @var{options}
@itemx --disassembler-options=@var{options}
Pass target specific information to the disassembler. Only supported on
-some targets.
+some targets. Note only a single instance of the option on the
+command line is supported. If the option occurs more than once, the
+earlier versions will be ignored. If it is necessary to specify more
+than one disassembler option then they should be placed together into
+a space separated list. ie:
+
+@smallexample
+ -M"first-disassembler-option second-disassembler-option"
+@end smallexample
If the target is an ARM architecture then this switch can be used to
select which register name set is used during disassembler. Specifying
@smallexample
@c man begin SYNOPSIS strip
-strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname} ]
- [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname} ]
- [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname} ]
- [@option{-s}|@option{--strip-all}] [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}]
- [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname} ]
- [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname} ]
- [@option{-x}|@option{--discard-all} ] [@option{-X} |@option{--discard-locals}]
- [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname} ]
- [@option{-o} @var{file} ] [@option{-p}|@option{--preserve-dates}]
+strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}]
+ [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname}]
+ [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname}]
+ [@option{-s}|@option{--strip-all}]
+ [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}]
+ [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname}]
+ [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname}]
+ [@option{-x}|@option{--discard-all}] [@option{-X} |@option{--discard-locals}]
+ [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}]
+ [@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}]
+ [@option{--only-keep-debug}]
[@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}]
[@option{--help}] [@option{--info}]
@var{objfile}@dots{}
Remove compiler-generated local symbols.
(These usually start with @samp{L} or @samp{.}.)
+@item --only-keep-debug
+Strip a file, removing any sections that would be stripped by
+@option{--strip-debug} and leaving the debugging sections.
+
+The intention is that this option will be used in conjunction with
+@option{--add-gnu-debuglink} to create a two part executable. One a
+stripped binary which will occupy less space in RAM and in a
+distribution and the second a debugging information file which is only
+needed if debugging abilities are required. The suggested procedure
+to create these files is as follows:
+
+@enumerate
+@item Link the executable as normal. Assuming that is is called
+@code{foo} then...
+@item Run @code{objcopy --only-keep-debug foo foo.dbg} to
+create a file containing the debugging info.
+@item Run @code{objcopy --strip-debug foo} to create a
+stripped executable.
+@item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo}
+to add a link to the debugging info into the stripped executable.
+@end enumerate
+
+Note - the choice of @code{.dbg} as an extension for the debug info
+file is arbitrary. Also the @code{--only-keep-debug} step is
+optional. You could instead do this:
+
+@enumerate
+@item Link the executable as normal.
+@item Copy @code{foo} to @code{foo.full}
+@item Run @code{strip --strip-debug foo}
+@item Run @code{objcopy --add-gnu-debuglink=foo.full foo}
+@end enumerate
+
+ie the file pointed to by the @option{--add-gnu-debuglink} can be the
+full executable. It does not have to be a file created by the
+@option{--only-keep-debug} switch.
+
@item -V
@itemx --version
Show the version number for @command{strip}.
@command{windres} will use the first non-option argument, after any used
for the input file name, as the output file name. If there is no
non-option argument, then @command{windres} will write to standard output.
-@command{windres} can not write a COFF file to standard output.
+@command{windres} can not write a COFF file to standard output. Note,
+for compatability with @command{rc} the option @option{-fo} is also
+accepted, but its use is not recommended.
-@item -I @var{format}
+@item -J @var{format}
@itemx --input-format @var{format}
The input format to read. @var{format} may be @samp{res}, @samp{rc}, or
@samp{coff}. If no input format is specified, @command{windres} will
to use, including any leading arguments. The default preprocessor
argument is @code{gcc -E -xc-header -DRC_INVOKED}.
-@item --include-dir @var{directory}
+@item -I @var{directory}
+@itemx --include-dir @var{directory}
Specify an include directory to use when reading an @code{rc} file.
@command{windres} will pass this to the preprocessor as an @option{-I}
option. @command{windres} will also search this directory when looking for
-files named in the @code{rc} file.
+files named in the @code{rc} file. If the argument passed to this command
+matches any of the supported @var{formats} (as descrived in the @option{-J}
+option), it will issue a deprecation warning, and behave just like the
+@option{-J} option. New programs should not use this behaviour. If a
+directory happens to match a @var{format}, simple prefix it with @samp{./}
+to disable the backward compatibility.
@item -D @var{target}
@itemx --define @var{sym}[=@var{val}]
Specify a @option{-D} option to pass to the preprocessor when reading an
@code{rc} file.
+@item -U @var{target}
+@itemx --undefine @var{sym}
+Specify a @option{-U} option to pass to the preprocessor when reading an
+@code{rc} file.
+
+@item -r
+Ignored for compatibility with rc.
+
@item -v
Enable verbose mode. This tells you what the preprocessor is if you
didn't specify one.
+@item -l @var{val}
@item --language @var{val}
Specify the default language to use when reading an @code{rc} file.
@var{val} should be a hexadecimal language code. The low eight bits are
Use popen, not a temporary file, to read the output of the preprocessor.
This is the default behaviour.
+@item -h
@item --help
Prints a usage summary.
+@item -V
@item --version
Prints the version number for @command{windres}.