From patchwork Fri Mar 3 14:47:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Samuelsson X-Patchwork-Id: 63961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp449423wrd; Fri, 3 Mar 2023 06:51:03 -0800 (PST) X-Google-Smtp-Source: AK7set9wsVcUheHV1naTCX+uqrI6E+XXeSGenGVegnGZMH91i1ESH6jQ51zok0yfWG+uwItq3BSF X-Received: by 2002:a17:906:3fd2:b0:8ae:fa9f:d58e with SMTP id k18-20020a1709063fd200b008aefa9fd58emr1797136ejj.53.1677855063215; Fri, 03 Mar 2023 06:51:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855063; cv=none; d=google.com; s=arc-20160816; b=nGbBrM76166cxlRcn9iok7xaqxy5KaUx3v/RpGQOmyE0rWTdFRDfUa2l/5pQgfhOBx o4XhN7LgMySPuAT2/SorF2xXYSipwtPwKGIRy7ifSSFYoK34cQA7JwfaTfTvcPCdTPMN PMcr1xPGnGf7CqA1FJx2ToxLSnKeyEBotUHlYj4AWDvbq/1X8zMTIgvV2ZhnCIR0ztt6 U/83BMJZgkYVJF55KeulBuZYj8O1aTQ0tjv2JOYYvS3FPsdV0FG553668qhrqJQVW22g Ah9RE8DQL7NIvo5rx+o84L+EGa9d5Jg8HS8tiS73wCBd3obL7xENrABpeQvLMf174E2a yENA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=szA5ZYmSOpTgYaBIar02sJmOqiAmrFHi88DFFuTG7J8=; b=VWQPS/JpugzwMroUGWFpduHiyLPhqVlNKzd4rf4vZySBWnBKSMexgDzwiBxQb/D+5C WKP73dqQN8ens35ZJJrNamyU8sM147979eEekpoVdwYc8XybJZwRa/iPOgJz94qEzJ6l uISGWLaZeg3z+RLwnQseZhVeGsDW+TMmfU9GoAF1b16qdpL7tcT6eVbLlrHl23QVG3Li 2NbEeFwYMZW5BtRLvjLUijbUIY7afXOBmZTqt2S3oNS4zMdMZWjGbmh2URjlyS40Vjxv yk9Kcw+W6IlFjf6fikQtVqzoAqZS7mOBkB9RT9XIRstUJTV0qvaF4ZnaAQTsLnluMRGR 3s4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=SRcL1qLY; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gx22-20020a170906f1d600b008e320b4ca7esi2432236ejb.677.2023.03.03.06.51.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:51:03 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=SRcL1qLY; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A423C3847806 for ; Fri, 3 Mar 2023 14:49:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A423C3847806 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677854953; bh=szA5ZYmSOpTgYaBIar02sJmOqiAmrFHi88DFFuTG7J8=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=SRcL1qLYEkavOef6bJ5TIH+O1A2FxE2jget1n/eoli/IonqXJRty8B3lUMRXHJkrW qGUwZluJpQsdMMgAekvLiIcf8u30y+/7qnsN2BoF5U4nUJxsEUuc12leYfURkUhss7 JsJmzKNqzNN6IFStfd6E0vXuk5I0gvzCNcpB3UjU= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from emagii.se (www.emagii.com [185.133.207.17]) by sourceware.org (Postfix) with ESMTPS id BE7AD3854803 for ; Fri, 3 Mar 2023 14:48:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE7AD3854803 Received: from valinor.ownit.se (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 9FB6E1201A8; Fri, 3 Mar 2023 15:48:06 +0100 (CET) Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) To: binutils@sourceware.org Cc: nickc@redhat.com, Ulf Samuelsson Subject: [PATCH v11 08/11] DIGEST: ldlang.*: add timestamp Date: Fri, 3 Mar 2023 15:47:03 +0100 Message-Id: <20230303144706.1977061-9-binutils@emagii.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230303144706.1977061-1-binutils@emagii.com> References: <20230303144706.1977061-1-binutils@emagii.com> MIME-Version: 1.0 X-PPP-Message-ID: <167785488794.1849796.8299382626533218276@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_FAIL, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ulf Samuelsson via Binutils From: Ulf Samuelsson Reply-To: binutils@emagii.com Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759358550766767611?= X-GMAIL-MSGID: =?utf-8?q?1759358550766767611?= From: Ulf Samuelsson Signed-off-by: Ulf Samuelsson --- 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 +#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 *);