This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Fix strip.
- To: Ulrich Kunitz <gefm21 at uumail dot de>
- Subject: PATCH: Fix strip.
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Sun, 24 Jun 2001 08:31:40 -0700
- Cc: binutils at sourceware dot cygnus dot com
- References: <20010624132815.A1279@uumail.de>
On Sun, Jun 24, 2001 at 01:28:15PM +0200, Ulrich Kunitz wrote:
> Dear H.J.,
>
> The strip command from binutils 2.11.90.0.19 doesn't support option -s
> in the same way as older versions like binutils 2.9.5 from my SuSE 6.4
> distribution.
>
> It seems that option string for getopt_long() in strip_main() from
> objcopy.c is wrong. Here is my patch:
>
Somehow the patch to strip_main in
http://sources.redhat.com/ml/binutils/2001-05/msg00314.html
got applied as
- while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXVv",
+ while ((c = getopt_long (argc, argv, "b:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXVvW:",
It is simply wrong. Here is a patch. I also added `-G' and `-W' to
strip_usage. I will check it in under the obvious fix rule.
H.J.
-----
2001-06-24 H.J. Lu <hjl@gnu.org>
* objcopy.c (strip_usage): Add `-G' and `-W'.
(strip_main): Correct options.
Index: objcopy.c
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/objcopy.c,v
retrieving revision 1.21
diff -u -p -r1.21 objcopy.c
--- objcopy.c 2001/06/23 06:45:37 1.21
+++ objcopy.c 2001/06/24 15:24:36
@@ -419,6 +419,8 @@ strip_usage (stream, exit_status)
--strip-unneeded Remove all symbols not needed by relocations\n\
-N --strip-symbol <name> Do not copy symbol <name>\n\
-K --keep-symbol <name> Only copy symbol <name>\n\
+ -G --keep-global-symbol <name> Localize all symbols except <name>\n\
+ -W --weaken-symbol <name> Force symbol <name> to be marked as a weak\n\
-x --discard-all Remove all non-global symbols\n\
-X --discard-locals Remove any compiler-generated symbols\n\
-v --verbose List all object files modified\n\
@@ -1845,7 +1847,7 @@ strip_main (argc, argv)
struct section_list *p;
char *output_file = NULL;
- while ((c = getopt_long (argc, argv, "b:i:o:I:j:K:N:s:O:d:F:L:G:R:SpgxXVvW:",
+ while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:R:sSpdgxXVvW:"
strip_options, (int *) 0)) != EOF)
{
switch (c)