This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] Facilitate deterministic pe executables between linker invocations
- From: Cory Fields <cory at coryfields dot com>
- To: nick clifton <nickc at redhat dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Thu, 10 Oct 2013 14:48:27 -0400
- Subject: Re: [PATCH] Facilitate deterministic pe executables between linker invocations
- Authentication-results: sourceware.org; auth=none
- References: <1380649206-19367-1-git-send-email-cory at coryfields dot com> <5256B553 dot 8040307 at redhat dot com> <CAApLimgHaLTS8cq9u1=wqU3y53b2ZteW9-EAf5ieM1pkqy==Xg at mail dot gmail dot com>
- Reply-to: cory at coryfields dot com
On Thu, Oct 10, 2013 at 10:40 AM, Cory Fields <firstname.lastname@example.org> wrote:
> On Thu, Oct 10, 2013 at 10:10 AM, nick clifton <email@example.com> wrote:
>> Hi Cory,
>> [Sorry for the delay in replying]
> No problem, thanks for getting to it.
>>> Only a tiny change is needed to avoid the random result. An
>>> (entirely arbitrary) value of 1 is hard-coded rather than using the
>>> Is there a historical reason for the non-deterministic behavior?
>> Yes. :-)
>> Oh, you want to know the reason ? I believe that this is because
>> non-deterministic behaviour was not considered to be important, and that
>> having a timestamped executable was thought to be a helpful feature. (For
>> example the timestamp could be used like a build-id to identify a specific
>> release of a binary to a customer).
> Yea, that's about what I expected to hear :\
>>> If so, would
>>> it be reasonable to add an option similar to enable-deterministic-archives
>>> disable it?
>> Yes it would.
> Great, then I'm happy to do the work. A few quick questions:
> - Are there other viable targets you can think of beyond PE executables?
> - What do you think about making this a runtime ld option as well?
> e.g. -D to match ar's. It'd be a shame to be at the mercy of my distro
> for this.
> - Is it worth considering a generic "attempt deterministic behavior"
> configure option that would bring behavior like this and ar's under
> one roof? I'm assuming not since there are presumably cases where
> someone might want one but not the other, just throwing it out there.
I've taken another look, and it looks like a pe-specific emulation
flag makes the most sense. I'll hook that up and send it along unless
you have a different suggestion.