From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2124) id DA7E53858D3C; Tue, 7 Mar 2023 13:57:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA7E53858D3C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Clifton To: bfd-cvs@sourceware.org Subject: [binutils-gdb] DIGEST: ldlang.*: add timestamp X-Act-Checkin: binutils-gdb X-Git-Author: Ulf Samuelsson X-Git-Refname: refs/heads/master X-Git-Oldrev: c8f8653fa7eeb3dc0769ac23039eadb5c5f09dff X-Git-Newrev: bd9466d4aa277a469a9d8b12f0a6e6fa51678e36 Message-Id: <20230307135719.DA7E53858D3C@sourceware.org> Date: Tue, 7 Mar 2023 13:57:19 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2023 13:57:20 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dbd9466d4aa27= 7a469a9d8b12f0a6e6fa51678e36 commit bd9466d4aa277a469a9d8b12f0a6e6fa51678e36 Author: Ulf Samuelsson Date: Mon Mar 6 14:31:55 2023 +0100 DIGEST: ldlang.*: add timestamp =20 Signed-off-by: Ulf Samuelsson Diff: --- 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 @@ =20 #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); } =20 +/* 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 *);