]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/binutils-tumbl.git/commitdiff
binutils/
authorRoland McGrath <roland@gnu.org>
Mon, 7 Jan 2013 17:42:43 +0000 (17:42 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 7 Jan 2013 17:42:43 +0000 (17:42 +0000)
* objcopy.c (deterministic): Make int rather than bfd_boolean,
initialize to -1.
(strip_options, copy_options): Add -U/--disable-deterministic-archives.
(default_deterministic): New function.
(strip_main, copy_main): Handle -U.  Call default_deterministic.
(copy_usage, strip_usage): Describe -U.  Cite whether -D or -U is
the default based on DEFAULT_AR_DETERMINISTIC.
* doc/binutils.texi (objcopy, strip): Describe -U and effect of
configure options on -D.

* ar.c (default_deterministic): Comment fix.

binutils/ChangeLog
binutils/ar.c
binutils/doc/binutils.texi
binutils/objcopy.c

index c9d6c51d97ba5a251a4ae2ff1c8802921b0de188..ac7dc1485a5490063c211c42fad3abdaf5b13fe4 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-07  Roland McGrath  <mcgrathr@google.com>
+
+       * objcopy.c (deterministic): Make int rather than bfd_boolean,
+       initialize to -1.
+       (strip_options, copy_options): Add -U/--disable-deterministic-archives.
+       (default_deterministic): New function.
+       (strip_main, copy_main): Handle -U.  Call default_deterministic.
+       (copy_usage, strip_usage): Describe -U.  Cite whether -D or -U is
+       the default based on DEFAULT_AR_DETERMINISTIC.
+       * doc/binutils.texi (objcopy, strip): Describe -U and effect of
+       configure options on -D.
+
+       * ar.c (default_deterministic): Comment fix.
+
 2012-11-05  Alan Modra  <amodra@gmail.com>
 
        * configure.in: Apply 2012-09-10 change to config.in here.  Add
index aceb9d1384336a7190a9dcaf4fd0a1c85b25fbe0..0aa1ba3220b28683c1aab26290f3b37a3c5a2f70 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -575,7 +575,7 @@ decode_options (int argc, char **argv)
   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)
index 9826eb20e116bec86c7c1cef95bb338eb3a3af24..45174b739e568d8f7f01fc373035e010ffeced3d 100644 (file)
@@ -1060,6 +1060,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}]
         [@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}]
@@ -1328,10 +1329,28 @@ as those of the input file.
 
 @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
@@ -2709,6 +2728,7 @@ strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}]
       [@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}]
@@ -2801,10 +2821,28 @@ Preserve the access and modification dates of the file.
 
 @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
index 40250adc4bb656a0099a82f0149b3fdcf913c8a5..020d54d6fbe27a5c90600e1d034a93e8fade0ff6 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -86,7 +86,7 @@ static int copy_width = 1;
 
 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
@@ -325,6 +325,7 @@ enum command_line_switch
 
 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'},
@@ -376,6 +377,7 @@ static struct option copy_options[] =
   {"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'},
@@ -489,9 +491,20 @@ copy_usage (FILE *stream, int exit_status)
   -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\
@@ -602,8 +615,20 @@ strip_usage (FILE *stream, int exit_status)
   -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\
@@ -3015,6 +3040,15 @@ write_debugging_info (bfd *obfd, void *dhandle,
   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[])
 {
@@ -3075,6 +3109,9 @@ strip_main (int argc, char *argv[])
        case 'D':
          deterministic = TRUE;
          break;
+       case 'U':
+         deterministic = FALSE;
+         break;
        case 'x':
          discard_locals = LOCALS_ALL;
          break;
@@ -3119,6 +3156,8 @@ strip_main (int argc, char *argv[])
   if (show_version)
     print_version ("strip");
 
+  default_deterministic ();
+
   /* Default is to strip all symbols.  */
   if (strip_symbols == STRIP_UNDEF
       && discard_locals == LOCALS_UNDEF
@@ -3201,7 +3240,7 @@ set_pe_subsystem (const char *s)
     }
   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 },
@@ -3443,6 +3482,10 @@ copy_main (int argc, char *argv[])
          deterministic = TRUE;
          break;
 
+       case 'U':
+         deterministic = FALSE;
+         break;
+
        case 'w':
          wildcard = TRUE;
          break;
@@ -3877,7 +3920,7 @@ copy_main (int argc, char *argv[])
        case OPTION_FILE_ALIGNMENT:
          pe_file_alignment = parse_vma (optarg, "--file-alignment");
          break;
-       
+
        case OPTION_HEAP:
            {
              char *end;
@@ -3895,20 +3938,20 @@ copy_main (int argc, char *argv[])
                }
            }
          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;
@@ -3926,7 +3969,7 @@ copy_main (int argc, char *argv[])
                }
            }
          break;
-       
+
        case 0:
          /* We've been given a long option.  */
          break;
@@ -3965,6 +4008,8 @@ copy_main (int argc, char *argv[])
   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;