(copy_options): Likewise.
(copy_usage): Mention --keep-symbol and -K.
(strip_usage): Likewise.
(keep_symbols): New static variable.
(is_strip_symbol): Adjust the return value according to
keep_symbols.
(strip_main): Handle -K. For -N, check that -K was not given.
(copy_main): Likewise.
* binutils.texi, objcopy.1, strip.1: Document -K.
[ -I @var{bfdname} | --input-target=@var{bfdname} ]
[ -O @var{bfdname} | --output-target=@var{bfdname} ]
[ -S | --strip-all ] [ -g | --strip-debug ]
+ [ -K @var{symbolname} | --keep-symbol=@var{symbolname} ]
[ -N @var{symbolname} | --strip-symbol=@var{symbolname} ]
[ -x | --discard-all ] [ -X | --discard-locals ]
[ -b @var{byte} | --byte=@var{byte} ]
@itemx --strip-debug
Do not copy debugging symbols from the source file.
+@item -K @var{symbolname}
+@itemx --keep-symbol=@var{symbolname}
+Copy only symbol @var{symbolname} from the source file. This option may
+be given more than once.
+
@item -N @var{symbolname}
@itemx --strip-symbol=@var{symbolname}
-Do not copy symbol @var{symbolname} from the source file. This option
-may be given more than once, and may be combined with other strip
-options.
+Do not copy symbol @var{symbolname} from the source file. This option
+may be given more than once, and may be combined with strip options
+other than @code{-K}.
@item -x
@itemx --discard-all
[ -I @var{bfdname} | --input-target=@var{bfdname} ]
[ -O @var{bfdname} | --output-target=@var{bfdname} ]
[ -s | --strip-all ] [ -S | -g | --strip-debug ]
+ [ -K @var{symbolname} | --keep-symbol=@var{symbolname} ]
[ -N @var{symbolname} | --strip-symbol=@var{symbolname} ]
[ -x | --discard-all ] [ -X | --discard-locals ]
[ -R @var{sectionname} | --remove-section=@var{sectionname} ]
@itemx --strip-debug
Remove debugging symbols only.
+@item -K @var{symbolname}
+@itemx --keep-symbol=@var{symbolname}
+Keep only symbol @var{symbolname} from the source file. This option may
+be given more than once.
+
@item -N @var{symbolname}
@itemx --strip-symbol=@var{symbolname}
-Remove symbol @var{symbolname} from the source file. This option
-may be given more than once, and may be combined with other strip
-options.
+Remove symbol @var{symbolname} from the source file. This option may be
+given more than once, and may be combined with strip options other than
+@code{-K}.
@item -x
@itemx --discard-all
.na
.TP
.B objcopy
-.RB "[\|" \-F\ \fIbfdname\fB\ |\ \-\-target=\fIbfdname\fR "\|]"
-.RB "[\|" \-I\ \fIbfdname\fB\ |\ \-\-input\-target=\fIbfdname\fR "\|]"
-.RB "[\|" \-O\ \fIbfdname\fB\ |\ \-\-output\-target=\fIbfdname\fR "\|]"
-.RB "[\|" \-R\ \fIsectionname\fB\ |\ \-\-remove\-section=\fIsectionname\fR "\|]"
-.RB "[\|" \-S\ |\ \-\-strip\-all\fR "\|]"
-.RB "[\|" \-g\ |\ \-\-strip\-debug\fR "\|]"
-.RB "[\|" \-N\ \fIsymbolname\fR\ |\ \-\-strip\-symbol=\fIsymbolname\fR "\|]"
-.RB "[\|" \-x\ |\ \-\-discard\-all\fR "\|]"
-.RB "[\|" \-X\ |\ \-\-discard\-locals\fR "\|]"
+.RB "[\|" \-F\ \fIbfdname\fR\ |\ \fB\-\-target=\fIbfdname\fR "\|]"
+.RB "[\|" \-I\ \fIbfdname\fR\ |\ \fB\-\-input\-target=\fIbfdname\fR "\|]"
+.RB "[\|" \-O\ \fIbfdname\fR\ |\ \fB\-\-output\-target=\fIbfdname\fR "\|]"
+.RB "[\|" \-R\ \fIsectionname\fR\ |\ \fB\-\-remove\-section=\fIsectionname\fR "\|]"
+.RB "[\|" \-S\fR\ |\ \fB\-\-strip\-all\fR "\|]"
+.RB "[\|" \-g\fR\ |\ \fB\-\-strip\-debug\fR "\|]"
+.RB "[\|" \-K\ \fIsymbolname\fR\ |\ \fB\-\-keep\-symbol=\fIsymbolname\fR "\|]"
+.RB "[\|" \-N\ \fIsymbolname\fR\ |\ \fB\-\-strip\-symbol=\fIsymbolname\fR "\|]"
+.RB "[\|" \-x\fR\ |\ \fB\-\-discard\-all\fR "\|]"
+.RB "[\|" \-X\fR\ |\ \fB\-\-discard\-locals\fR "\|]"
.RB "[\|" \-b\ \fIbyte\fR\ |\ \fB\-\-byte=\fIbyte\fR "\|]"
.RB "[\|" \-i\ \fIinterleave\fR\ |\ \fB\-\-interleave=\fIinterleave\fR "\|]"
.RB "[\|" \-\-gap\-fill=\fIval\fR "\|]"
.B \-g\fR, \fB\-\-strip\-debug
Do not copy debugging symbols from the source file.
.TP
+.B \-K \fIsymbolname\fR, \fB\-\-keep\-symbol=\fIsymbolname
+Copy only symbol \fIsymbolname\fP from the source file. This option
+may be given more than once.
+.TP
.B \-N \fIsymbolname\fR, \fB\-\-strip\-symbol=\fIsymbolname
Do not copy symbol \fIsymbolname\fP from the source file. This option
-may be given more than once, and may be combined with other strip
-options.
+may be given more than once, and may be combined with strip options
+other than \fB\-K\fR.
.TP
.B \-x\fR, \fB \-\-discard\-all
Do not copy non-global symbols from the source file.
.na
.TP
.B strip
-.RB "[\|" \-F \fIbfdname\fP\ |\ \-\-target=\fIbfdname\fP "\|]"
-.RB "[\|" \-I \fIbfdname\fP\ |\ \-\-input\-target=\fIbfdname\fP "\|]"
-.RB "[\|" \-O \fIbfdname\fP\ |\ \-\-output\-target=\fIbfdname\fP "\|]"
-.RB "[\|" \-R \fIsectionname\fP\ |\ \-\-remove\-section=\fIsectionname\fP "\|]"
-.RB "[\|" \-s | \-\-strip\-all "\|]"
-.RB "[\|" \-S | -g | \-\-strip\-debug "\|]"
-.RB "[\|" \-x | \-\-discard\-all "\|]"
-.RB "[\|" \-X | \-\-discard\-locals "\|]"
-.RB "[\|" \-v | \-\-verbose "\|]"
-.RB "[\|" \-V | \-\-version "\|]"
-.RB "[\|" \-V | \-\-help "\|]"
+.RB "[\|" \-F\ \fIbfdname\fR\ |\ \fB\-\-target=\fIbfdname\fP "\|]"
+.RB "[\|" \-I\ \fIbfdname\fR\ |\ \fB\-\-input\-target=\fIbfdname\fP "\|]"
+.RB "[\|" \-O\ \fIbfdname\fR\ |\ \fB\-\-output\-target=\fIbfdname\fP "\|]"
+.RB "[\|" \-R\ \fIsectionname\fR\ |\ \fB\-\-remove\-section=\fIsectionname\fP "\|]"
+.RB "[\|" \-s\fR\ |\ \fB\-\-strip\-all "\|]"
+.RB "[\|" \-S\fR\ |\ \fB\-g\fR\ |\ \fB\-\-strip\-debug "\|]"
+.RB "[\|" \-x\fR\ |\ \fB\-\-discard\-all "\|]"
+.RB "[\|" \-X\fR\ |\ \fB\-\-discard\-locals "\|]"
+.RB "[\|" \-K\ \fIsymbolname\fR\ |\ \fB\-\-keep\-symbol=\fIsymbolname\fR "\|]"
+.RB "[\|" \-N\ \fIsymbolname\fR\ |\ \fB\-\-strip\-symbol=\fIsymbolname\fR "\|]"
+.RB "[\|" \-v\fR\ |\ \fB\-\-verbose "\|]"
+.RB "[\|" \-V\fR\ |\ \fB\-\-version "\|]"
+.RB "[\|" \-V\fR\ |\ \fB\-\-help "\|]"
.I objfile\c
\&.\|.\|.
Remove compiler-generated local symbols.
(These usually start with ``L'' or ``.''.)
+.TP
+.B \-K \fIsymbolname\fR, \fB\-\-keep\-symbol=\fIsymbolname
+Copy only symbol \fIsymbolname\fP from the source file. This option
+may be given more than once.
+
+.TP
+.B \-N \fIsymbolname\fR, \fB\-\-strip\-symbol=\fIsymbolname
+Do not copy symbol \fIsymbolname\fP from the source file. This option
+may be given more than once, and may be combined with strip options
+other than \fB\-K\fR.
+
.TP
.B \-v
.TP