/* ar.c - Archive modify and extract.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Free Software Foundation, Inc.
This file is part of GNU Binutils.
return &argv[optind];
}
-/* If neither -D nor -U was not specified explicitly,
+/* If neither -D nor -U was specified explicitly,
then use the configured default. */
static void
default_deterministic (void)
[@option{-R} @var{sectionname}|@option{--remove-section=}@var{sectionname}]
[@option{-p}|@option{--preserve-dates}]
[@option{-D}|@option{--enable-deterministic-archives}]
+ [@option{-U}|@option{--disable-deterministic-archives}]
[@option{--debugging}]
[@option{--gap-fill=}@var{val}]
[@option{--pad-to=}@var{address}]
@item -D
@itemx --enable-deterministic-archives
+@cindex deterministic archives
+@kindex --enable-deterministic-archives
Operate in @emph{deterministic} mode. When copying archive members
and writing the archive index, use zero for UIDs, GIDs, timestamps,
and use consistent file modes for all files.
+If @file{binutils} was configured with
+@option{--enable-deterministic-archives}, then this mode is on by default.
+It can be disabled with the @samp{-U} option, below.
+
+@item -U
+@itemx --disable-deterministic-archives
+@cindex deterministic archives
+@kindex --enable-deterministic-archives
+Do @emph{not} operate in @emph{deterministic} mode. This is the
+inverse of the @option{-D} option, above: when copying archive members
+and writing the archive index, use their actual UID, GID, timestamp,
+and file mode values.
+
+This is the default unless @file{binutils} was configured with
+@option{--enable-deterministic-archives}.
+
@item --debugging
Convert debugging information, if possible. This is not the default
because only certain debugging formats are supported, and the
[@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}]
[@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}]
[@option{-D}|@option{--enable-deterministic-archives}]
+ [@option{-U}|@option{--disable-deterministic-archives}]
[@option{--keep-file-symbols}]
[@option{--only-keep-debug}]
[@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}]
@item -D
@itemx --enable-deterministic-archives
+@cindex deterministic archives
+@kindex --enable-deterministic-archives
Operate in @emph{deterministic} mode. When copying archive members
and writing the archive index, use zero for UIDs, GIDs, timestamps,
and use consistent file modes for all files.
+If @file{binutils} was configured with
+@option{--enable-deterministic-archives}, then this mode is on by default.
+It can be disabled with the @samp{-U} option, below.
+
+@item -U
+@itemx --disable-deterministic-archives
+@cindex deterministic archives
+@kindex --enable-deterministic-archives
+Do @emph{not} operate in @emph{deterministic} mode. This is the
+inverse of the @option{-D} option, above: when copying archive members
+and writing the archive index, use their actual UID, GID, timestamp,
+and file mode values.
+
+This is the default unless @file{binutils} was configured with
+@option{--enable-deterministic-archives}.
+
@item -w
@itemx --wildcard
Permit regular expressions in @var{symbolname}s used in other command
/* objcopy.c -- copy object file from input to output, optionally massaging it.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Free Software Foundation, Inc.
This file is part of GNU Binutils.
static bfd_boolean verbose; /* Print file and target names. */
static bfd_boolean preserve_dates; /* Preserve input file timestamp. */
-static bfd_boolean deterministic; /* Enable deterministic archives. */
+static int deterministic = -1; /* Enable deterministic archives. */
static int status = 0; /* Exit status. */
enum strip_action
static struct option strip_options[] =
{
+ {"disable-deterministic-archives", no_argument, 0, 'U'},
{"discard-all", no_argument, 0, 'x'},
{"discard-locals", no_argument, 0, 'X'},
{"enable-deterministic-archives", no_argument, 0, 'D'},
{"compress-debug-sections", no_argument, 0, OPTION_COMPRESS_DEBUG_SECTIONS},
{"debugging", no_argument, 0, OPTION_DEBUGGING},
{"decompress-debug-sections", no_argument, 0, OPTION_DECOMPRESS_DEBUG_SECTIONS},
+ {"disable-deterministic-archives", no_argument, 0, 'U'},
{"discard-all", no_argument, 0, 'x'},
{"discard-locals", no_argument, 0, 'X'},
{"enable-deterministic-archives", no_argument, 0, 'D'},
-B --binary-architecture <arch> Set output arch, when input is arch-less\n\
-F --target <bfdname> Set both input and output format to <bfdname>\n\
--debugging Convert debugging information, if possible\n\
- -p --preserve-dates Copy modified/access timestamps to the output\n\
+ -p --preserve-dates Copy modified/access timestamps to the output\n"));
+ if (DEFAULT_AR_DETERMINISTIC)
+ fprintf (stream, _("\
+ -D --enable-deterministic-archives\n\
+ Produce deterministic output when stripping archives (default)\n\
+ -U --disable-deterministic-archives\n\
+ Disable -D behavior\n"));
+ else
+ fprintf (stream, _("\
-D --enable-deterministic-archives\n\
Produce deterministic output when stripping archives\n\
+ -U --disable-deterministic-archives\n\
+ Disable -D behavior (default)\n"));
+ fprintf (stream, _("\
-j --only-section <name> Only copy section <name> into the output\n\
--add-gnu-debuglink=<file> Add section .gnu_debuglink linking to <file>\n\
-R --remove-section <name> Remove section <name> from the output\n\
-O --output-target=<bfdname> Create an output file in format <bfdname>\n\
-F --target=<bfdname> Set both input and output format to <bfdname>\n\
-p --preserve-dates Copy modified/access timestamps to the output\n\
+"));
+ if (DEFAULT_AR_DETERMINISTIC)
+ fprintf (stream, _("\
+ -D --enable-deterministic-archives\n\
+ Produce deterministic output when stripping archives (default)\n\
+ -U --disable-deterministic-archives\n\
+ Disable -D behavior\n"));
+ else
+ fprintf (stream, _("\
-D --enable-deterministic-archives\n\
Produce deterministic output when stripping archives\n\
+ -U --disable-deterministic-archives\n\
+ Disable -D behavior (default)\n"));
+ fprintf (stream, _("\
-R --remove-section=<name> Remove section <name> from the output\n\
-s --strip-all Remove all symbol and relocation information\n\
-g -S -d --strip-debug Remove all debugging symbols & sections\n\
return FALSE;
}
+/* If neither -D nor -U was specified explicitly,
+ then use the configured default. */
+static void
+default_deterministic (void)
+{
+ if (deterministic < 0)
+ deterministic = DEFAULT_AR_DETERMINISTIC;
+}
+
static int
strip_main (int argc, char *argv[])
{
case 'D':
deterministic = TRUE;
break;
+ case 'U':
+ deterministic = FALSE;
+ break;
case 'x':
discard_locals = LOCALS_ALL;
break;
if (show_version)
print_version ("strip");
+ default_deterministic ();
+
/* Default is to strip all symbols. */
if (strip_symbols == STRIP_UNDEF
&& discard_locals == LOCALS_UNDEF
}
v[] =
{
- { "native", 0, IMAGE_SUBSYSTEM_NATIVE },
+ { "native", 0, IMAGE_SUBSYSTEM_NATIVE },
{ "windows", 0, IMAGE_SUBSYSTEM_WINDOWS_GUI },
{ "console", 0, IMAGE_SUBSYSTEM_WINDOWS_CUI },
{ "posix", 0, IMAGE_SUBSYSTEM_POSIX_CUI },
deterministic = TRUE;
break;
+ case 'U':
+ deterministic = FALSE;
+ break;
+
case 'w':
wildcard = TRUE;
break;
case OPTION_FILE_ALIGNMENT:
pe_file_alignment = parse_vma (optarg, "--file-alignment");
break;
-
+
case OPTION_HEAP:
{
char *end;
}
}
break;
-
+
case OPTION_IMAGE_BASE:
pe_image_base = parse_vma (optarg, "--image-base");
break;
-
+
case OPTION_SECTION_ALIGNMENT:
pe_section_alignment = parse_vma (optarg,
"--section-alignment");
break;
-
+
case OPTION_SUBSYSTEM:
set_pe_subsystem (optarg);
break;
-
+
case OPTION_STACK:
{
char *end;
}
}
break;
-
+
case 0:
/* We've been given a long option. */
break;
if (optind + 1 < argc)
output_filename = argv[optind + 1];
+ default_deterministic ();
+
/* Default is to strip no symbols. */
if (strip_symbols == STRIP_UNDEF && discard_locals == LOCALS_UNDEF)
strip_symbols = STRIP_NONE;