public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com, Ulf Samuelsson <ulf@emagii.com>
Subject: [PATCH v12 08/11] DIGEST: ldlang.*: add timestamp
Date: Mon,  6 Mar 2023 14:31:55 +0100	[thread overview]
Message-ID: <20230306133158.91917-9-binutils@emagii.com> (raw)
In-Reply-To: <20230306133158.91917-1-binutils@emagii.com>

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


  parent reply	other threads:[~2023-03-06 13:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 13:31 [PATCH v12 0/11 Add support for CRC64 generation in linker binutils
2023-03-06 13:31 ` [PATCH v12 01/11] DIGEST: LICENSING binutils
2023-03-06 13:31 ` [PATCH v12 02/11] DIGEST: NEWS binutils
2023-03-06 13:31 ` [PATCH v12 03/11] DIGEST: Documentation binutils
2023-03-06 13:31 ` [PATCH v12 04/11] DIGEST: testsuite binutils
2023-03-06 13:31 ` [PATCH v12 05/11] DIGEST: ldlex.l binutils
2023-03-06 13:31 ` [PATCH v12 06/11] DIGEST: ldgram.y binutils
2023-03-06 13:31 ` [PATCH v12 07/11] DIGEST: ldmain.c binutils
2023-03-06 13:31 ` binutils [this message]
2023-03-06 13:31 ` [PATCH v12 09/11] DIGEST: calculation binutils
2023-03-06 13:31 ` [PATCH v12 10/11] DIGEST: Makefile.* binutils
2023-03-06 13:31 ` [PATCH v12 11/11] Build ldint binutils
2023-03-07 13:59 ` [PATCH v12 0/11 Add support for CRC64 generation in linker Nick Clifton
2023-03-07 18:03   ` Ulf Samuelsson
2023-03-07 18:08   ` Ulf Samuelsson
2023-03-08  9:31     ` Martin Liška
2023-03-08 11:48       ` Ulf Samuelsson
2023-03-08 12:52         ` Nick Clifton
2023-03-08 13:23           ` Ulf Samuelsson
2023-03-08 12:57         ` Alan Modra
2023-03-08 13:39           ` Ulf Samuelsson
2023-03-09  8:48           ` Ulf Samuelsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230306133158.91917-9-binutils@emagii.com \
    --to=binutils@emagii.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=ulf@emagii.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).