/* objcopy.c -- copy object file from input to output, optionally massaging it.
- Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
+ Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This file is part of GNU Binutils.
#include "getopt.h"
#include "libiberty.h"
#include "budbg.h"
+#include "filenames.h"
#include <sys/stat.h>
/* A list of symbols to explicitly strip out, or to keep. A linked
struct section_list *p;
char *output_file = NULL;
- while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpgxXVv",
+ while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXVv",
strip_options, (int *) 0)) != EOF)
{
switch (c)
break;
case 'S':
case 'g':
+ case 'd': /* Historic BSD alias for -g. Used by early NetBSD. */
strip_symbols = STRIP_DEBUG;
break;
case OPTION_STRIP_UNNEEDED:
if (is_strip < 0)
{
int i = strlen (program_name);
- is_strip = (i >= 5 && strcmp (program_name + i - 5, "strip") == 0);
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ /* Drop the .exe suffix, if any. */
+ if (i > 4 && FILENAME_CMP (program_name + i - 4, ".exe") == 0)
+ {
+ i -= 4;
+ program_name[i] = '\0';
+ }
+#endif
+ is_strip = (i >= 5 && FILENAME_CMP (program_name + i - 5, "strip") == 0);
}
if (is_strip)