[PATCH] D43978: Write a hash of the binary as the PE Debug Directory Timestamp

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 07:23:32 PST 2018


thakis added a comment.

In https://reviews.llvm.org/D43978#1024821, @zturner wrote:

> Apparently this *still* isn't quite right.  The scenario presented to me was this:
>
> 1. User does a clean build, hash X gets written into PDB, hash Y gets written into EXE.
> 2. User archives EXE and PDB on symbol store.  EXE is in some directory X, PDB is in some directory Y.
> 3. User adds some blank lines and rebuilds.  EXE doesn't change but PDB does.
> 4. User re-archives.  EXE is unchanged so doesn't get updated on the symbol store, but PDB does.  PDB now gets archived in directory Z.
>
>   So now there is only one EXE, Y, but there are two PDBs, X and Z.  If you have the new source code, you will run the EXE, it will find it under directory Y in the sym store, map to the old PDB X, and the source won't match.


I don't understand this scenario. If the pdb changes, doesn't the RSDS header in the exe linking to the binary have to change as well? And then the hash will be updated, and all is good? https://blogs.msdn.microsoft.com/oldnewthing/20180103-00/?p=97705 sounds like link.exe really only hashes the binary.


https://reviews.llvm.org/D43978





More information about the llvm-commits mailing list