From b3364cb9c21f33b0f0de633d10f6729134b9bd6f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 29 Nov 2011 18:07:41 +0000 Subject: [PATCH] * 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. --- binutils/ChangeLog | 7 +++++++ binutils/ar.c | 11 +++++++++-- binutils/doc/binutils.texi | 27 +++++++++++++++++++-------- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f17c2f1c949..4074da392e7 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2011-11-29 Roland McGrath + + * 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 PR binutils/13421 diff --git a/binutils/ar.c b/binutils/ar.c index 882ef1ac0de..676e92cfd90 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -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)) diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index 684b3b7fe74..3217a1a3611 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -176,7 +176,7 @@ in the section entitled ``GNU Free Documentation License''. @c man title ar create, modify, and extract from archives @smallexample -ar [@option{--plugin} @var{name}] [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] [@option{--target} @var{bfdname}] @var{archive} [@var{member}@dots{}] +ar [@option{--plugin} @var{name}] [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] [@option{--target} @var{bfdname}] @var{archive} [@var{member}@dots{}] ar -M [