Re: [Mingw-w64-public] does linker correctly set the creation date of a PE file ?

2016-02-07 Thread Vincent Torri
It's not a problem of striping files or not (the debug section is not
involved here). But anyway, i've just did this :

gcc -g -O2 -o pi pi.c

then, I run the sigcheck tool. Here is the output :

$ /sigcheck.exe ./pi.exe

Sigcheck v2.50 - File version and signature viewer
Copyright (C) 2004-2016 Mark Russinovich
Sysinternals - www.sysinternals.com

E:\Documents\MSYS2\home\vtorri\code\pi.exe:
Verified:   Unsigned
Link date:  19:12 01/01/1970
Publisher:  n/a
Company:n/a
Description:n/a
Product:n/a
Prod version:   n/a
File version:   n/a
MachineType:64-bit

When I parse myself the TimeDateStamp field in the IMAGE_FILE_HEADER
structure, i obtain the same value.

My code (the relevant part) in Examine :



{
FILETIME ft;
FILETIME lft;
ULARGE_INTEGER uli;

#define EXM_WINDOWS_TICK 1000
#define EXM_SEC_TO_UNIX_EPOCH 11644473600ULL
uli.QuadPart = ((unsigned long
long)exm_pe_nt_header_get(pe)->FileHeader.TimeDateStamp +
EXM_SEC_TO_UNIX_EPOCH) * EXM_WINDOWS_TICK;
ft.dwLowDateTime = uli.LowPart;
ft.dwHighDateTime = uli.HighPart;
FileTimeToLocalFileTime(, );
if (!FileTimeToSystemTime(, ))
{
st.wHour = 0;
st.wMinute = 0;
st.wDay = 1;
st.wMonth = 1;
st.wYear = 1970;
}
}

printf("%02d:%02d %02d/%02d/%04d\n",
   st.wHour,
   st.wMinute,
   st.wDay,
   st.wMonth,
   st.wYear);



Vincent Torri


On Sun, Feb 7, 2016 at 10:56 AM, Nakai Yuta  wrote:
> I cannot reproduce that.
> maybe, you strip output binaries?
>
> 
> From: Vincent Torri 
> Sent: Sunday, February 7, 2016 17:34
> To: mingw-w64-public@lists.sourceforge.net
> Subject: [Mingw-w64-public] does linker correctly set the creation date of a  
>   PE file ?
>
> Hello
>
> with my little Examine tool, or with the 'sigcheck' tool from
> sysinternal, it seems that the TimeDateStamp field of the
> IMAGE_FILE_HEADER structure, which is "the date and time the image was
> created by the linker" (see
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms680313%28v=vs.85%29.aspx
> ) is not correctly set. It returns 01/01/1970 as date (the local time
> vary from file to file)
>
> Can someone confirm that ? If yes, is it possible to fix this ?
>
> thank you
>
> Vincent Torri
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] does linker correctly set the creation date of a PE file ?

2016-02-07 Thread Óscar Fuentes
Vincent Torri 
writes:

> Can someone confirm that ? If yes, is it possible to fix this ?

For obtaining reproducible binaries I had to pass --no-insert-timestamp
to the linker. That was last December, using the MSYS2's MinGW-w64
toolchain (32 bits).


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] does linker correctly set the creation date of a PE file ?

2016-02-07 Thread Vincent Torri
On Sun, Feb 7, 2016 at 6:42 PM, Óscar Fuentes  wrote:
> Vincent Torri 
> writes:
>
 Can someone confirm that ? If yes, is it possible to fix this ?
>>>
>>> For obtaining reproducible binaries I had to pass --no-insert-timestamp
>>> to the linker. That was last December, using the MSYS2's MinGW-w64
>>> toolchain (32 bits).
>>
>> i've just read that this option is not stable
>>
>> also, i don't want to remove timestamps, i want the linker to specify
>> the correct timestamp
>
> My point was that the linker is including the timestamps here, unless I
> explicitly command it to do otherwise.

my point is that the timestamp is incorrect (it is set to 0, which is wrong)

Vincent Torri

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] does linker correctly set the creation date of a PE file ?

2016-02-07 Thread Óscar Fuentes
Vincent Torri 
writes:

> my point is that the timestamp is incorrect (it is set to 0, which is wrong)

Yes, that was clear from your first message.

binutils can be cofigured with --enable-deterministic-archives. Maybe
your binutils was configured that way?

Please note that I don't know if that option impacts non-stripped
binaries. It certainly affects how `strip' works by default.


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] does linker correctly set the creation date of a PE file ?

2016-02-07 Thread Óscar Fuentes
Vincent Torri 
writes:

>>> Can someone confirm that ? If yes, is it possible to fix this ?
>>
>> For obtaining reproducible binaries I had to pass --no-insert-timestamp
>> to the linker. That was last December, using the MSYS2's MinGW-w64
>> toolchain (32 bits).
>
> i've just read that this option is not stable
>
> also, i don't want to remove timestamps, i want the linker to specify
> the correct timestamp

My point was that the linker is including the timestamps here, unless I
explicitly command it to do otherwise.


--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151=/4140
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public