[PATCH v1 0/6] TIMESTAMP output section command
Hans-Peter Nilsson
hp@bitrange.com
Thu Oct 9 06:03:29 GMT 2025
On Wed, 8 Oct 2025, Ulf Samuelsson wrote:
> Den 2025-10-08 kl. 10:17, skrev Alan Modra:
> > You can of course already insert a quad-word entry with the current
> > time, so this is really just syntactic sugar. One way is
> > INCLUDE timestamp.ld
> > in your script somewhere, then just before running the linker, run
> > echo ".QUAD `date '+%s'`" > timestamp.ld
I'll one-up Alan's suggestion: for your definition of a
timestamp, use the ld command-line option
"--defsym my_timestamp=`date '+%s'`"
and use
"QUAD(my_timestamp)" in the
linker script. Works with today's version.
And yesterday's, and ten years ago: I checked.
That it works with today's (and yester-year's) linker version,
not requiring any functionality, is important to embedded
developers.
brgds, H-P
/embedded developer
(mentioned only because I got the impression that was important)
More information about the Binutils
mailing list