Add support for removing named sections to objcopy and strip.

* objcopy.c (struct section_list): Define.
	(remove_sections): New static variable.
	(strip_options, copy_options): Add remove-section.
	(copy_usage, strip_usage): Mention -R and --remove-section.
	(setup_section): If section is in remove_sections list, ignore it.
	(copy_section): Likewise.
	(strip_main, copy_main): Handle -R.
	* binutils.texi, objcopy.1, strip.1: Document new options.
This commit is contained in:
Ian Lance Taylor
1994-08-11 19:00:26 +00:00
parent 97e7b66f5e
commit 0aca460e7c
4 changed files with 47 additions and 3 deletions

View File

@@ -11,10 +11,14 @@
strip \- Discard symbols from object files.
.SH SYNOPSIS
.hy 0
.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 "[\|" \-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 "\|]"
@@ -65,6 +69,14 @@ code format \fIbfdname\fP.
.B "\-\-output\-target=\fIbfdname"
Replace \fIobjfile\fP with a file in the output format \fIbfdname\fP.
.TP
.B "\-R \fIsectionname\fP"
.TP
.B "\-\-remove\-section=\fIsectionname"
Remove the named section from the file. This option may be given more
than once. Note that using this option inappropriately may make the
object file unusable.
.TP
.B \-s
.TP