* ar.c (ranlib_usage): Describe -D.

(ranlib_main): Parse -D.
	(ranlib_touch): Set BFD_DETERMINISTIC_OUTPUT under -D.
	* doc/binutils.texi (ranlib): Describe -D, and also --help/-h/-H.
This commit is contained in:
Roland McGrath
2011-11-29 18:07:41 +00:00
parent a35ad96ac8
commit b3364cb9c2
3 changed files with 35 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2011-11-29 Roland McGrath <mcgrathr@google.com>
* ar.c (ranlib_usage): Describe -D.
(ranlib_main): Parse -D.
(ranlib_touch): Set BFD_DETERMINISTIC_OUTPUT under -D.
* doc/binutils.texi (ranlib): Describe -D, and also --help/-h/-H.
2011-11-28 Nick Clifton <nickc@redhat.com>
PR binutils/13421

View File

@ -324,6 +324,7 @@ ranlib_usage (int help)
#endif
fprintf (s, _("\
-t Update the archive's symbol map timestamp\n\
-D Use zero for the symbol map timestamp\n\
-h --help Print this help message\n\
-v --version Print version information\n"));
@ -559,10 +560,13 @@ ranlib_main (int argc, char **argv)
bfd_boolean touch = FALSE;
int c;
while ((c = getopt_long (argc, argv, "hHvVt", long_options, NULL)) != EOF)
while ((c = getopt_long (argc, argv, "DhHvVt", long_options, NULL)) != EOF)
{
switch (c)
{
case 'D':
deterministic = TRUE;
break;
case 'h':
case 'H':
show_help = 1;
@ -581,7 +585,7 @@ ranlib_main (int argc, char **argv)
ranlib_usage (0);
if (show_help)
usage (1);
ranlib_usage (1);
if (show_version)
print_version ("ranlib");
@ -1365,6 +1369,9 @@ ranlib_touch (const char *archname)
/* xgettext:c-format */
fatal (_("%s: no archive map to update"), archname);
if (deterministic)
arch->flags |= BFD_DETERMINISTIC_OUTPUT;
bfd_update_armap_timestamp (arch);
if (! bfd_close (arch))

View File

@ -2349,7 +2349,7 @@ nm(1), readelf(1), and the Info entries for @file{binutils}.
@smallexample
@c man begin SYNOPSIS ranlib
ranlib [@option{-vVt}] @var{archive}
ranlib [@option{-DhHvVt}] @var{archive}
@c man end
@end smallexample
@ -2374,11 +2374,22 @@ The @sc{gnu} @command{ranlib} program is another form of @sc{gnu} @command{ar};
@c man begin OPTIONS ranlib
@table @env
@item -h
@itemx -H
@itemx --help
Show usage information for @command{ranlib}.
@item -v
@itemx -V
@itemx --version
Show the version number of @command{ranlib}.
@item -D
@cindex deterministic archives
Operate in @emph{deterministic} mode. The symbol map archive member's
header will show zero for the UID, GID, and timestamp. When this
option is used, multiple runs will produce identical output files.
@item -t
Update the timestamp of the symbol map of an archive.
@end table