[v11,08/11] DIGEST: ldlang.*: add timestamp
Checks
Commit Message
From: Ulf Samuelsson <ulf@emagii.com>
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
---
ld/ldlang.c | 8 ++++++++
ld/ldlang.h | 2 ++
2 files changed, 10 insertions(+)
@@ -20,6 +20,7 @@
#include "sysdep.h"
#include <limits.h>
+#include <time.h>
#include "bfd.h"
#include "libiberty.h"
#include "filenames.h"
@@ -8520,6 +8521,13 @@ lang_add_string (size_t size, const char *s)
free (string);
}
+/* Store the time of linking in the image */
+void
+lang_add_timestamp (void)
+{
+ lang_add_data (QUAD, exp_intop ((bfd_vma) time (0)));
+}
+
/* Create a new reloc statement. RELOC is the BFD relocation type to
generate. HOWTO is the corresponding howto structure (we could
look this up, but the caller has already done so). SECTION is the
@@ -649,6 +649,8 @@ extern void lang_add_data
extern bfd_vma charcount(const char *s);
extern void lang_add_string
(size_t, const char *s);
+extern void lang_add_timestamp
+ (void);
extern void lang_add_reloc
(bfd_reloc_code_real_type, reloc_howto_type *, asection *, const char *,
union etree_union *);