From: Ulf Samuelsson Date: Mon, 6 Mar 2023 13:31:55 +0000 (+0100) Subject: DIGEST: ldlang.*: add timestamp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd9466d4aa277a469a9d8b12f0a6e6fa51678e36;p=binutils-gdb.git DIGEST: ldlang.*: add timestamp Signed-off-by: Ulf Samuelsson --- 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 +#include #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 *);