[LLD][COFF] Don't take into account the 'age' when looking for PDB type server
The age field is only there to say how many times an OBJ or a PDB was incrementally linked. It shouldn't be used to validate the link between the OBJ and the PDB.
Differential Revision: https://reviews.llvm.org/D62837
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@362572 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/COFF/DebugTypes.cpp b/COFF/DebugTypes.cpp
index bcdb33f..770de80 100644
--- a/COFF/DebugTypes.cpp
+++ b/COFF/DebugTypes.cpp
@@ -198,9 +198,9 @@
pdb::InfoStream &Info = cantFail(PDBFile.getPDBInfoStream());
// Just because a file with a matching name was found doesn't mean it can be
- // used. The GUID and Age must match between the PDB header and the OBJ
+ // used. The GUID must match between the PDB header and the OBJ
// TypeServer2 record. The 'Age' is used by MSVC incremental compilation.
- if (Info.getGuid() != TS.getGuid() || Info.getAge() != TS.getAge())
+ if (Info.getGuid() != TS.getGuid())
return createFileError(
TS.Name,
make_error<pdb::PDBError>(pdb::pdb_error_code::signature_out_of_date));
diff --git a/test/COFF/Inputs/pdb-type-server-valid-signature.yaml b/test/COFF/Inputs/pdb-type-server-valid-signature.yaml
index 23656d1..dd95a3d 100644
--- a/test/COFF/Inputs/pdb-type-server-valid-signature.yaml
+++ b/test/COFF/Inputs/pdb-type-server-valid-signature.yaml
@@ -69,7 +69,7 @@
- Kind: LF_TYPESERVER2
TypeServer2:
Guid: '{8DABD2A0-28FF-CB43-9BAF-175B77B76414}'
- Age: 1
+ Age: 18
Name: 'pdb-diff-cl.pdb'
- Name: '.text$mn'
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]