[PATCH v1 0/6] TIMESTAMP output section command
Ulf Samuelsson
binutils@emagii.com
Tue Oct 7 17:51:20 GMT 2025
Den 2025-10-07 kl. 18:11, skrev Joseph Myers:
> On Tue, 7 Oct 2025, binutils@emagii.com wrote:
>
>> 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)
> In the modern world of reproducible builds, embedding timestamps in output
> files is an antipattern and new instances of it should be avoided.
> Anything embedding a timestamp for legacy reasons needs to respect
> SOURCE_DATE_EPOCH (via using bfd_get_current_time, for example);
That is certainly something that can be added, but this can be very
complex for a system that does not have that support.
I believe in this case, the SOURCE_DATE_VARIABLE should be used if it is
set, but use a generated timestamp if it is not set.
> anything new should not determine a timestamp itself but might use an identifier
> passed into the linker by a command-line option so it's the responsibility
> of an external build system to pass in the timestamp it wants to use if it
> wants to use one.
I think that then you would be better of setting the SOURCE_DATE_EPOCH
environment variable
--
Best Regards,
Ulf Samuelsson
+46722 427437
More information about the Binutils
mailing list