[PATCH v1 0/6] TIMESTAMP output section command
Hans-Peter Nilsson
hp@bitrange.com
Thu Oct 9 10:49:39 GMT 2025
On Thu, 9 Oct 2025, Ulf Samuelsson wrote:
> Den 2025-10-09 kl. 08:03, skrev Hans-Peter Nilsson:
> > 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.
> It is possible to do it this way. That does not mean that it is a good way to
> implement it this way.
> The current linker decides on timestamp without having to specify something as
> a command line
> option when you generate the timestamp for an ELF header or similar.
>
> If the SOURCE_DATE_EPOCH environment variable is set and valid it will be
> used.
> If not, the current time will be used.
The above statements follow a logical line of reason.
(Not saying I agree with that line, but it's there.)
> Is there any reason why we want to do this differently for embedded system?
Then this out of the blue. Totally non-sequitur. Different to
what? What "embedded system" context (or non-embedded system
context for that matter) is it that you refer to that is
different to something else?
> > That it works with today's (and yester-year's) linker version,
> > not requiring any functionality, is important to embedded
> > developers.
>
> Assume that 10,000 projects implements timestamp this way.
Building a strawman here.
> Then, they are forced by regulations to use "SOURCE_DATE_EPOCH" to implement
> timestamps.
Is there such a proposal somewhere? Please link!
I'd say it could be just as likely that there was a regulation
that it must *not* be affected by environment variables!
Please use logical reasoning when arguing about patches!
Argument claims should be verifiable.
brgds, H-P
/Still an embedded developer.
More information about the Binutils
mailing list