[PATCH v2 4/6] ld:TIMESTAMP: ld.texi

binutils@emagii.com binutils@emagii.com
Tue Oct 14 16:49:46 GMT 2025


From: Ulf Samuelsson <ulf@emagii.com>

The TIMESTAMP command inserts a QUAD-word entry with the current time
into the image at the current location.
The value is the number of seconds since the Epoch,
1970-01-01 00:00:00 +0000 (UTC)

Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
---
 ld/ld.texi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/ld/ld.texi b/ld/ld.texi
index cf750d15259..726381957f7 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -5787,6 +5787,7 @@ C identifiers because they contain a @samp{.} character.
 @kindex LONG(@var{expression})
 @kindex QUAD(@var{expression})
 @kindex SQUAD(@var{expression})
+
 You can include explicit bytes of data in an output section by using
 @code{BYTE}, @code{SHORT}, @code{LONG}, @code{QUAD}, or @code{SQUAD} as
 an output section command.  Each keyword is followed by an expression in
@@ -7015,6 +7016,11 @@ The target's maximum page size.
 @item COMMONPAGESIZE
 @kindex COMMONPAGESIZE
 The target's default page size.
+
+@item SOURCE_DATE_EPOCH
+@kindex SOURCE_DATE_EPOCH
+The value of the SOURCE_DATE_EPOCH environment variable,
+or current time if not defined.
 @end table
 
 So for example:
@@ -7722,6 +7728,14 @@ the @code{SIZEOF_HEADERS} function, or you must rework your linker
 script to avoid forcing the linker to use additional program headers, or
 you must define the program headers yourself using the @code{PHDRS}
 command (@pxref{PHDRS}).
+
+@item TIMESTAMP
+@kindex TIMESTAMP
+@cindex header size
+Return the value of the @code{SOURCE_DATE_EPOCH} environment variable or
+if undefined, the current time. The value is the number of seconds
+since the Epoch, @code{1970-01-01 00:00:00 +0000 (UTC)}.
+
 @end table
 
 @node Implicit Linker Scripts
-- 
2.17.1



More information about the Binutils mailing list