[PATCH v1 0/6] TIMESTAMP output section command

Ulf Samuelsson binutils@emagii.com
Wed Oct 8 15:46:32 GMT 2025
Den 2025-10-08 kl. 10:17, skrev Alan Modra:
> On Tue, Oct 07, 2025 at 02:39:31PM +0200, binutils@emagii.com wrote:
>> [PATCH v1 1/6] ld:TIMESTAMP command, ldlex.l
>> [PATCH v1 2/6] ld:TIMESTAMP command, ldgram.y
>> [PATCH v1 3/6] ld:TIMESTAMP command, ldlang.*
>> [PATCH v1 4/6] ld:TIMESTAMP info
>> [PATCH v1 5/6] ld:TIMESTAMP ChangeLog
>> [PATCH v1 6/6] ld:TIMESTAMP NEWS
>>
>> ld:TIMESTAMP command
>>      
>> Add TIMESTAMP command to linker.
>>      
>> 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)
>>
>> The main purpose for the command is for application headers
>> in embedded systems which often require a timestamp to be able to
>> exactly identify the build.
>>
>> For now, it is a patchset of 6 patches.
>> Will be merged into a single patch if/when accepted
> 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

Thanks, but I am thinking that there are thousands of embedded projects,
and even if it is small simplification, when you multiply it with thousands
of projects, it makes sense to me to have the syntactic sugar.

The suggestion by Joseph Myers to use SOURCE_DATE_EPOCH as a preferred 
value for the
timestamp makes sense as there is move towards standardization here.
To suggest that each developer figures out that you can add a timestamp
using an include file is non-intuitive.
Each user will have to come up with his own filename, which will be 
different from anyone else.
It is a move away from standardization.

-- 
Best Regards
Ulf Samuelsson



More information about the Binutils mailing list