diff options
Diffstat (limited to 'elfutils/src/arlib.c')
-rw-r--r-- | elfutils/src/arlib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/elfutils/src/arlib.c b/elfutils/src/arlib.c index af98454c..bcf9344b 100644 --- a/elfutils/src/arlib.c +++ b/elfutils/src/arlib.c @@ -1,5 +1,5 @@ /* Functions to handle creation of Linux archives. - Copyright (C) 2007 Red Hat, Inc. + Copyright (C) 2007-2012 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2007. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -61,7 +61,7 @@ arlib_init (void) /* Using snprintf here has a problem: the call always wants to add a NUL byte. We could use a trick whereby we specify the target buffer size longer than it is and this would not actually fail, - since all the fields are consecutive and we fill them in in + since all the fields are consecutive and we fill them in sequence (i.e., the NUL byte gets overwritten). But _FORTIFY_SOURCE=2 would not let us play these games. Therefore we play it safe. */ @@ -69,7 +69,8 @@ arlib_init (void) memcpy (ar_hdr.ar_date, tmpbuf, snprintf (tmpbuf, sizeof (tmpbuf), "%-*lld", (int) sizeof (ar_hdr.ar_date), - (long long int) time (NULL))); + (arlib_deterministic_output ? 0 + : (long long int) time (NULL)))); assert ((sizeof (struct ar_hdr) % sizeof (uint32_t)) == 0); /* Note the string for the ar_uid and ar_gid cases is longer than |