This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: binutils-2.11.2 strip -s wierdness

Magnus Damm wrote:
> Hi folks,
> I've used binutils-2.10 for quite some time,
> and now I've upgraded to 2.11.2.
> I have one wierd problem to report.
> "strip -s" works fine with 2.10, but fails with 2.11.2.
> "strip --strip-all" seems to work though.
> Either "strip --help" gives wrong information about -s, or
> strip acts wierd.

This behaviour is caused by the merge of the objcopy and the strip
program which had happened between 2.10 and 2.11.x. It also caused
another failure when invoking strip as follows:

$ strip -o a.stripped a.out
Usage: strip <switches> in-file(s)
The switches are:

Both problems are fixed by the attached patch; can someone with
write permission please install it in the branch?

TIA, cheers.


> I've cross-compiled binutils for a ppc-linux.
> Please CC me - I'm not on this list.
> Thanks /
> Magnus
> damm@sepang:~/scdb/scdb_20010907x/root/scl-0.01/mpc8xx/xxx/bin$
> ../../install/host/usr/bin/ppc-linux-strip -s busybox
> Usage: ../../install/host/usr/bin/ppc-linux-strip <switches> in-file(s)
>  The switches are:
>   -I --input-target <bfdname>      Assume input file is in format
> <bfdname>
>   -O --output-target <bfdname>     Create an output file in format
> <bfdname>
>   -F --target <bfdname>            Set both input and output format to
> <bfdname>
>   -p --preserve-dates              Copy modified/access timestamps to
> the output
>   -R --remove-section <name>       Remove section <name> from the output
>   -s --strip-all                   Remove all symbol and relocation
> information
>   -g -S --strip-debug              Remove all debugging symbols
>      --strip-unneeded              Remove all symbols not needed by
> relocations
>   -N --strip-symbol <name>         Do not copy symbol <name>
>   -K --keep-symbol <name>          Only copy symbol <name>
>   -x --discard-all                 Remove all non-global symbols
>   -X --discard-locals              Remove any compiler-generated symbols
>   -v --verbose                     List all object files modified
>   -V --version                     Display this program's version number
>   -h --help                        Display this output
>   -o <file>                        Place stripped output into <file>
> ../../install/host/usr/bin/ppc-linux-strip: supported targets:
> elf32-powerpc aixcoff-rs6000 elf32-powerpcle ppcboot elf32-little
> elf32-big srec symbolsrec tekhex binary ihex
> damm@sepang:~/scdb/scdb_20010907x/root/scl-0.01/mpc8xx/xxx/bin$
> ../../install/host/usr/bin/ppc-linux-strip --strip-all busybox
> damm@sepang:~/scdb/scdb_20010907x/root/scl-0.01/mpc8xx/xxx/bin$
2001-09-12  Manfred Hollstein  <>

	* objcopy.c (strip_main): -s/--strip-all option doesn't take an

2001-07-25  Manfred Hollstein  <>

	* objcopy.c (strip_options): Add entry for the --output-file
	command line flag.
	(strip_main): Add entry for -o/--output-file argument.

diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el binutils-2.11.2.orig/binutils/objcopy.c binutils-2.11.2/binutils/objcopy.c
--- binutils-2.11.2.orig/binutils/objcopy.c	Thu Jun  7 05:12:27 2001
+++ binutils-2.11.2/binutils/objcopy.c	Wed Sep 12 16:47:28 2001
@@ -238,6 +238,7 @@ static struct option strip_options[] =
   {"input-format", required_argument, 0, 'I'}, /* Obsolete */
   {"input-target", required_argument, 0, 'I'},
   {"keep-symbol", required_argument, 0, 'K'},
+  {"output-file", required_argument, 0, 'o'},
   {"output-format", required_argument, 0, 'O'},	/* Obsolete */
   {"output-target", required_argument, 0, 'O'},
   {"preserve-dates", no_argument, 0, 'p'},
@@ -1835,7 +1836,7 @@ strip_main (argc, argv)
   struct section_list *p;
   char *output_file = NULL;
-  while ((c = getopt_long (argc, argv, "b:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXVvW:",
+  while ((c = getopt_long (argc, argv, "b:i:I:j:K:N:o:O:d:F:L:G:R:sSpgxXVvW:",
 			   strip_options, (int *) 0)) != EOF)
       switch (c)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]