public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v7 08/11] DIGEST: ldlang.*: add timestamp
@ 2023-03-01 17:30 binutils
  2023-03-01 17:30 ` [PATCH v7 09/11] DIGEST: calculation binutils
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: binutils @ 2023-03-01 17:30 UTC (permalink / raw)
  To: binutils; +Cc: nickc, Ulf Samuelsson

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(+)

diff --git a/ld/ldlang.c b/ld/ldlang.c
index 295de015da9..77917027f83 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 2300fa5b2a3..ef785ae5cad 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -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 *);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-01 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 17:30 [PATCH v7 08/11] DIGEST: ldlang.*: add timestamp binutils
2023-03-01 17:30 ` [PATCH v7 09/11] DIGEST: calculation binutils
2023-03-01 17:30 ` [PATCH v7 10/11] DIGEST: Makefile.* binutils
2023-03-01 17:30 ` [PATCH v7 11/11] Build ldint binutils

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).