[lld] 98bc304 - [lld][COFF] Fix TypeServerSource lookup on GUID collisions

Tobias Hieta via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 2 01:09:12 PDT 2022


Author: Tobias Hieta
Date: 2022-04-02T10:09:07+02:00
New Revision: 98bc304e9faded44f1d8988ffa4c5d8b50c759ec

URL: https://github.com/llvm/llvm-project/commit/98bc304e9faded44f1d8988ffa4c5d8b50c759ec
DIFF: https://github.com/llvm/llvm-project/commit/98bc304e9faded44f1d8988ffa4c5d8b50c759ec.diff

LOG: [lld][COFF] Fix TypeServerSource lookup on GUID collisions

Microsoft shipped a bunch of PDB files with broken/invalid GUIDs
which lead lld to use 0xFF as the key for these files in an internal
cache. When multiple files have this key it will lead to collisions
and confused symbol lookup.

Several approaches to fix this was considered. Including making the key
the path to the PDB file, but this requires some filesystem operations
in order to normalize the file path.

Since this only happens with malformatted PDB files and we haven't
seen this before they malformatted files where shipped with visual
studio we probably shouldn't optimize for this use-case.

Instead we now just don't insert files with Guid == 0xFF into the
cache map and warn if we get collisions so similar problems can be
found in the future instead of being silent.

Discussion about the root issue and the approach to this fix can be found on Github: https://github.com/llvm/llvm-project/issues/54487

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D122372

Added: 
    lld/test/COFF/Inputs/pdb-type-server-guid-collision-a-pdb.yaml
    lld/test/COFF/Inputs/pdb-type-server-guid-collision-a.yaml
    lld/test/COFF/Inputs/pdb-type-server-guid-collision-b-pdb.yaml
    lld/test/COFF/Inputs/pdb-type-server-guid-collision-b.yaml
    lld/test/COFF/pdb-type-server-guid-collision-invalid.test
    lld/test/COFF/pdb-type-server-guid-collision-valid.test

Modified: 
    lld/COFF/DebugTypes.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index 67b708c5b36a7..3b3f43f1bf15b 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -56,8 +56,15 @@ class TypeServerSource : public TpiSource {
       return;
     Guid = expectedInfo->getGuid();
     auto it = ctx.typeServerSourceMappings.emplace(Guid, this);
-    assert(it.second);
-    (void)it;
+    if (!it.second) {
+      // If we hit here we have collision on Guid's in two PDB files.
+      // This can happen if the PDB Guid is invalid or if we are really
+      // unlucky. This should fall back on stright file-system lookup.
+      TypeServerSource *tSrc = (TypeServerSource *)it.first->second;
+      log("GUID collision between " + file.getFilePath() + " and " +
+          tSrc->pdbInputFile->session->getPDBFile().getFilePath());
+      ctx.typeServerSourceMappings.erase(Guid);
+    }
   }
 
   Error mergeDebugT(TypeMerger *m) override;

diff  --git a/lld/test/COFF/Inputs/pdb-type-server-guid-collision-a-pdb.yaml b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-a-pdb.yaml
new file mode 100644
index 0000000000000..5092a4102f827
--- /dev/null
+++ b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-a-pdb.yaml
@@ -0,0 +1,1018 @@
+---
+PdbStream:
+  Age:             1
+  Guid:            '{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}'
+  Features:        [ VC140 ]
+  Version:         VC70
+TpiStream:
+  Version:         VC80
+  Records:
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::moduleAttribute'
+        UniqueName:      '.?AUmoduleAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            dll
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            exe
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            service
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4
+            Name:            unspecified
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            EXE
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            SERVICE
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  6
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4097
+        Name:            '__vc_attributes::moduleAttribute::type_e'
+        UniqueName:      '.?AW4type_e at moduleAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_MODIFIER
+      Modifier:
+        ModifiedType:    112
+        Modifiers:       [ None, Const ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4099
+        Attrs:           65548
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4098, 4100, 4100, 4100, 116, 48, 4100, 116,
+                           4100, 4100, 116, 48, 48, 4100, 4100 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4096
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4096
+        ThisType:        4102
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  15
+        ArgumentList:    4101
+        ThisPointerAdjustment: 0
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4098 ]
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4096
+        ThisType:        4102
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4104
+        ThisPointerAdjustment: 0
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [  ]
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4096
+        ThisType:        4102
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4106
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4103
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4105
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4107
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4098
+            Name:            type_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    3
+            MethodList:      4108
+            Name:            moduleAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4098
+            FieldOffset:     0
+            Name:            type
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     8
+            Name:            name
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     16
+            Name:            version
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     24
+            Name:            uuid
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     32
+            Name:            lcid
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     36
+            Name:            control
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     40
+            Name:            helpstring
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     48
+            Name:            helpstringcontext
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     56
+            Name:            helpstringdll
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     64
+            Name:            helpfile
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     72
+            Name:            helpcontext
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     76
+            Name:            hidden
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     77
+            Name:            restricted
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     80
+            Name:            custom
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4100
+            FieldOffset:     88
+            Name:            resource_name
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     19
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4109
+        Name:            '__vc_attributes::moduleAttribute'
+        UniqueName:      '.?AUmoduleAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            96
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::event_receiverAttribute'
+        UniqueName:      '.?AUevent_receiverAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            native
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            com
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            managed
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  3
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4112
+        Name:            '__vc_attributes::event_receiverAttribute::type_e'
+        UniqueName:      '.?AW4type_e at event_receiverAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4113, 48 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4111
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4111
+        ThisType:        4115
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  2
+        ArgumentList:    4114
+        ThisPointerAdjustment: 0
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4113 ]
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4111
+        ThisType:        4115
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4117
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4111
+        ThisType:        4115
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4106
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4116
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4118
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4119
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4113
+            Name:            type_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    3
+            MethodList:      4120
+            Name:            event_receiverAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4113
+            FieldOffset:     0
+            Name:            type
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     4
+            Name:            layout_dependent
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     6
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4121
+        Name:            '__vc_attributes::event_receiverAttribute'
+        UniqueName:      '.?AUevent_receiverAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            8
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::aggregatableAttribute'
+        UniqueName:      '.?AUaggregatableAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            never
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            allowed
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            always
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  3
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4124
+        Name:            '__vc_attributes::aggregatableAttribute::type_e'
+        UniqueName:      '.?AW4type_e at aggregatableAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4125 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4123
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4123
+        ThisType:        4127
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4126
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4123
+        ThisType:        4127
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4106
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4128
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4129
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4125
+            Name:            type_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    2
+            MethodList:      4130
+            Name:            aggregatableAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4125
+            FieldOffset:     0
+            Name:            type
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     4
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4131
+        Name:            '__vc_attributes::aggregatableAttribute'
+        UniqueName:      '.?AUaggregatableAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::threadingAttribute'
+        UniqueName:      '.?AUthreadingAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            apartment
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            single
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            free
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4
+            Name:            neutral
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           5
+            Name:            both
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  5
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4134
+        Name:            '__vc_attributes::threadingAttribute::threading_e'
+        UniqueName:      '.?AW4threading_e at threadingAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4135 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4133
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4133
+        ThisType:        4137
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4136
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4133
+        ThisType:        4137
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4106
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4138
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4139
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4135
+            Name:            threading_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    2
+            MethodList:      4140
+            Name:            threadingAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4135
+            FieldOffset:     0
+            Name:            value
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     4
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4141
+        Name:            '__vc_attributes::threadingAttribute'
+        UniqueName:      '.?AUthreadingAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::helper_attributes::usageAttribute'
+        UniqueName:      '.?AUusageAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            eAnyUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            eCoClassUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            eCOMInterfaceUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           6
+            Name:            eInterfaceUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           8
+            Name:            eMemberUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16
+            Name:            eMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           32
+            Name:            eInterfaceMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           64
+            Name:            eInterfaceMemberUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           128
+            Name:            eCoClassMemberUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           256
+            Name:            eCoClassMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           768
+            Name:            eGlobalMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1024
+            Name:            eGlobalDataUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2048
+            Name:            eClassUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4096
+            Name:            eInterfaceParameterUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           12288
+            Name:            eMethodParameterUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16384
+            Name:            eIDLModuleUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           32768
+            Name:            eAnonymousUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           65536
+            Name:            eTypedefUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           131072
+            Name:            eUnionUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           262144
+            Name:            eEnumUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           524288
+            Name:            eDefineTagUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1048576
+            Name:            eStructUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2097152
+            Name:            eLocalUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4194304
+            Name:            ePropertyUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           8388608
+            Name:            eEventUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16777216
+            Name:            eTemplateUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16777216
+            Name:            eModuleUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           33554432
+            Name:            eIllegalUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           67108864
+            Name:            eAsynchronousUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4161535
+            Name:            eAnyIDLUsage
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  30
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4144
+        Name:            '__vc_attributes::helper_attributes::usageAttribute::usage_e'
+        UniqueName:      '.?AW4usage_e at usageAttribute@helper_attributes at __vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 117 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4143
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4143
+        ThisType:        4147
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4146
+        ThisPointerAdjustment: 0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4145
+            Name:            usage_e
+        - Kind:            LF_ONEMETHOD
+          OneMethod:
+            Type:            4148
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            usageAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            117
+            FieldOffset:     0
+            Name:            value
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     3
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4149
+        Name:            '__vc_attributes::helper_attributes::usageAttribute'
+        UniqueName:      '.?AUusageAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::helper_attributes::v1_alttypeAttribute'
+        UniqueName:      '.?AUv1_alttypeAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            eBoolean
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            eInteger
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            eFloat
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            eDouble
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  4
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4152
+        Name:            '__vc_attributes::helper_attributes::v1_alttypeAttribute::type_e'
+        UniqueName:      '.?AW4type_e at v1_alttypeAttribute@helper_attributes at __vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4153 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4151
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4151
+        ThisType:        4155
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4154
+        ThisPointerAdjustment: 0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4153
+            Name:            type_e
+        - Kind:            LF_ONEMETHOD
+          OneMethod:
+            Type:            4156
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            v1_alttypeAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4153
+            FieldOffset:     0
+            Name:            type
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     3
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4157
+        Name:            '__vc_attributes::helper_attributes::v1_alttypeAttribute'
+        UniqueName:      '.?AUv1_alttypeAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::event_sourceAttribute'
+        UniqueName:      '.?AUevent_sourceAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  3
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4112
+        Name:            '__vc_attributes::event_sourceAttribute::type_e'
+        UniqueName:      '.?AW4type_e at event_sourceAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            speed
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            size
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  2
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4161
+        Name:            '__vc_attributes::event_sourceAttribute::optimize_e'
+        UniqueName:      '.?AW4optimize_e at event_sourceAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4160 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4159
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4159
+        ThisType:        4164
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4163
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4159
+        ThisType:        4164
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4106
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4165
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4166
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4160
+            Name:            type_e
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4162
+            Name:            optimize_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    2
+            MethodList:      4167
+            Name:            event_sourceAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4160
+            FieldOffset:     0
+            Name:            type
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4162
+            FieldOffset:     4
+            Name:            optimize
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     8
+            Name:            decorate
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     7
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4168
+        Name:            '__vc_attributes::event_sourceAttribute'
+        UniqueName:      '.?AUevent_sourceAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            12
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            Foo
+        UniqueName:      '.?AUFoo@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     0
+            Name:            x
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     1
+        Options:         [ None, HasUniqueName ]
+        FieldList:       4171
+        Name:            Foo
+        UniqueName:      '.?AUFoo@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+...

diff  --git a/lld/test/COFF/Inputs/pdb-type-server-guid-collision-a.yaml b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-a.yaml
new file mode 100644
index 0000000000000..1881d85ce76cd
--- /dev/null
+++ b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-a.yaml
@@ -0,0 +1,171 @@
+--- !COFF
+header:
+  Machine:         IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [  ]
+sections:
+  - Name:            .drectve
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    Alignment:       1
+    SectionData:     2020202F44454641554C544C49423A224C4942434D5422202F44454641554C544C49423A224F4C444E414D45532220
+  - Name:            '.debug$S'
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    Subsections:
+      - !Symbols
+        Records:
+          - Kind:            S_OBJNAME
+            ObjNameSym:
+              Signature:       0
+              ObjectName:      'C:\Users\tobia\code\tmp\a.obj'
+          - Kind:            S_COMPILE3
+            Compile3Sym:
+              Flags:           [ SecurityChecks, HotPatch ]
+              Machine:         X64
+              FrontendMajor:   19
+              FrontendMinor:   29
+              FrontendBuild:   30140
+              FrontendQFE:     0
+              BackendMajor:    19
+              BackendMinor:    29
+              BackendBuild:    30140
+              BackendQFE:      0
+              Version:         'Microsoft (R) Optimizing Compiler'
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       __vc_attributes
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       helper_attributes
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       atl
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       std
+      - !Symbols
+        Records:
+          - Kind:            S_GDATA32
+            DataSym:
+              Type:            4172
+              DisplayName:     foo_gv
+          - Kind:            S_UDT
+            UDTSym:
+              Type:            4172
+              UDTName:         Foo
+      - !StringTable
+        Strings:         []
+      - !Symbols
+        Records:
+          - Kind:            S_BUILDINFO
+            BuildInfoSym:
+              BuildId:         4122
+    Relocations:
+      - VirtualAddress:  184
+        SymbolName:      '?foo_gv@@3UFoo@@A'
+        Type:            IMAGE_REL_AMD64_SECREL
+      - VirtualAddress:  188
+        SymbolName:      '?foo_gv@@3UFoo@@A'
+        Type:            IMAGE_REL_AMD64_SECTION
+  - Name:            '.debug$T'
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    Types:
+      - Kind:            LF_TYPESERVER2
+        TypeServer2:
+          Guid:            '{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}'
+          Age:             1
+          Name:            'C:\Users\tobia\code\tmp\a.pdb'
+  - Name:            .bss
+    Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     ''
+    SizeOfRawData:   4
+  - Name:            .chks64
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    SectionData:     23076615271ABF1A3D62E233B91184E60A19DCEE7A1989FD00000000000000000000000000000000
+symbols:
+  - Name:            '@comp.id'
+    Value:           17135036
+    SectionNumber:   -1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            '@feat.00'
+    Value:           2147549584
+    SectionNumber:   -1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            '@vol.md'
+    Value:           2
+    SectionNumber:   -1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .drectve
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          47
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            '.debug$S'
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          1060
+      NumberOfRelocations: 2
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            '.debug$T'
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          60
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            .bss
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          4
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            '?foo_gv@@3UFoo@@A'
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            .chks64
+    Value:           0
+    SectionNumber:   5
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          40
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+...

diff  --git a/lld/test/COFF/Inputs/pdb-type-server-guid-collision-b-pdb.yaml b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-b-pdb.yaml
new file mode 100644
index 0000000000000..55e8b616ca36f
--- /dev/null
+++ b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-b-pdb.yaml
@@ -0,0 +1,1018 @@
+---
+PdbStream:
+  Age:             1
+  Guid:            '{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}'
+  Features:        [ VC140 ]
+  Version:         VC70
+TpiStream:
+  Version:         VC80
+  Records:
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            Bar
+        UniqueName:      '.?AUBar@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     0
+            Name:            x
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     1
+        Options:         [ None, HasUniqueName ]
+        FieldList:       4097
+        Name:            Bar
+        UniqueName:      '.?AUBar@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::moduleAttribute'
+        UniqueName:      '.?AUmoduleAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            dll
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            exe
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            service
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4
+            Name:            unspecified
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            EXE
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            SERVICE
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  6
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4100
+        Name:            '__vc_attributes::moduleAttribute::type_e'
+        UniqueName:      '.?AW4type_e at moduleAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_MODIFIER
+      Modifier:
+        ModifiedType:    112
+        Modifiers:       [ None, Const ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4102
+        Attrs:           65548
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4101, 4103, 4103, 4103, 116, 48, 4103, 116,
+                           4103, 4103, 116, 48, 48, 4103, 4103 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4099
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4099
+        ThisType:        4105
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  15
+        ArgumentList:    4104
+        ThisPointerAdjustment: 0
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4101 ]
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4099
+        ThisType:        4105
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4107
+        ThisPointerAdjustment: 0
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [  ]
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4099
+        ThisType:        4105
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4109
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4106
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4108
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4110
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4101
+            Name:            type_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    3
+            MethodList:      4111
+            Name:            moduleAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4101
+            FieldOffset:     0
+            Name:            type
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     8
+            Name:            name
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     16
+            Name:            version
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     24
+            Name:            uuid
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     32
+            Name:            lcid
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     36
+            Name:            control
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     40
+            Name:            helpstring
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     48
+            Name:            helpstringcontext
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     56
+            Name:            helpstringdll
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     64
+            Name:            helpfile
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            116
+            FieldOffset:     72
+            Name:            helpcontext
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     76
+            Name:            hidden
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     77
+            Name:            restricted
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     80
+            Name:            custom
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4103
+            FieldOffset:     88
+            Name:            resource_name
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     19
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4112
+        Name:            '__vc_attributes::moduleAttribute'
+        UniqueName:      '.?AUmoduleAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            96
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::event_receiverAttribute'
+        UniqueName:      '.?AUevent_receiverAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            native
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            com
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            managed
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  3
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4115
+        Name:            '__vc_attributes::event_receiverAttribute::type_e'
+        UniqueName:      '.?AW4type_e at event_receiverAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4116, 48 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4114
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4114
+        ThisType:        4118
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  2
+        ArgumentList:    4117
+        ThisPointerAdjustment: 0
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4116 ]
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4114
+        ThisType:        4118
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4120
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4114
+        ThisType:        4118
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4109
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4119
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4121
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4122
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4116
+            Name:            type_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    3
+            MethodList:      4123
+            Name:            event_receiverAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4116
+            FieldOffset:     0
+            Name:            type
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     4
+            Name:            layout_dependent
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     6
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4124
+        Name:            '__vc_attributes::event_receiverAttribute'
+        UniqueName:      '.?AUevent_receiverAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            8
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::aggregatableAttribute'
+        UniqueName:      '.?AUaggregatableAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            never
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            allowed
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            always
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  3
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4127
+        Name:            '__vc_attributes::aggregatableAttribute::type_e'
+        UniqueName:      '.?AW4type_e at aggregatableAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4128 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4126
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4126
+        ThisType:        4130
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4129
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4126
+        ThisType:        4130
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4109
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4131
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4132
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4128
+            Name:            type_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    2
+            MethodList:      4133
+            Name:            aggregatableAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4128
+            FieldOffset:     0
+            Name:            type
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     4
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4134
+        Name:            '__vc_attributes::aggregatableAttribute'
+        UniqueName:      '.?AUaggregatableAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::threadingAttribute'
+        UniqueName:      '.?AUthreadingAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            apartment
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            single
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            free
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4
+            Name:            neutral
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           5
+            Name:            both
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  5
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4137
+        Name:            '__vc_attributes::threadingAttribute::threading_e'
+        UniqueName:      '.?AW4threading_e at threadingAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4138 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4136
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4136
+        ThisType:        4140
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4139
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4136
+        ThisType:        4140
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4109
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4141
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4142
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4138
+            Name:            threading_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    2
+            MethodList:      4143
+            Name:            threadingAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4138
+            FieldOffset:     0
+            Name:            value
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     4
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4144
+        Name:            '__vc_attributes::threadingAttribute'
+        UniqueName:      '.?AUthreadingAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::helper_attributes::usageAttribute'
+        UniqueName:      '.?AUusageAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            eAnyUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            eCoClassUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            eCOMInterfaceUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           6
+            Name:            eInterfaceUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           8
+            Name:            eMemberUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16
+            Name:            eMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           32
+            Name:            eInterfaceMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           64
+            Name:            eInterfaceMemberUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           128
+            Name:            eCoClassMemberUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           256
+            Name:            eCoClassMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           768
+            Name:            eGlobalMethodUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1024
+            Name:            eGlobalDataUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2048
+            Name:            eClassUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4096
+            Name:            eInterfaceParameterUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           12288
+            Name:            eMethodParameterUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16384
+            Name:            eIDLModuleUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           32768
+            Name:            eAnonymousUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           65536
+            Name:            eTypedefUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           131072
+            Name:            eUnionUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           262144
+            Name:            eEnumUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           524288
+            Name:            eDefineTagUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1048576
+            Name:            eStructUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2097152
+            Name:            eLocalUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4194304
+            Name:            ePropertyUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           8388608
+            Name:            eEventUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16777216
+            Name:            eTemplateUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           16777216
+            Name:            eModuleUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           33554432
+            Name:            eIllegalUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           67108864
+            Name:            eAsynchronousUsage
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           4161535
+            Name:            eAnyIDLUsage
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  30
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4147
+        Name:            '__vc_attributes::helper_attributes::usageAttribute::usage_e'
+        UniqueName:      '.?AW4usage_e at usageAttribute@helper_attributes at __vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 117 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4146
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4146
+        ThisType:        4150
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4149
+        ThisPointerAdjustment: 0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4148
+            Name:            usage_e
+        - Kind:            LF_ONEMETHOD
+          OneMethod:
+            Type:            4151
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            usageAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            117
+            FieldOffset:     0
+            Name:            value
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     3
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4152
+        Name:            '__vc_attributes::helper_attributes::usageAttribute'
+        UniqueName:      '.?AUusageAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::helper_attributes::v1_alttypeAttribute'
+        UniqueName:      '.?AUv1_alttypeAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            eBoolean
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            eInteger
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           2
+            Name:            eFloat
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           3
+            Name:            eDouble
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  4
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4155
+        Name:            '__vc_attributes::helper_attributes::v1_alttypeAttribute::type_e'
+        UniqueName:      '.?AW4type_e at v1_alttypeAttribute@helper_attributes at __vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4156 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4154
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4154
+        ThisType:        4158
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4157
+        ThisPointerAdjustment: 0
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4156
+            Name:            type_e
+        - Kind:            LF_ONEMETHOD
+          OneMethod:
+            Type:            4159
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            v1_alttypeAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4156
+            FieldOffset:     0
+            Name:            type
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     3
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4160
+        Name:            '__vc_attributes::helper_attributes::v1_alttypeAttribute'
+        UniqueName:      '.?AUv1_alttypeAttribute at helper_attributes@__vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            4
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     0
+        Options:         [ None, ForwardReference, HasUniqueName ]
+        FieldList:       0
+        Name:            '__vc_attributes::event_sourceAttribute'
+        UniqueName:      '.?AUevent_sourceAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            0
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  3
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4115
+        Name:            '__vc_attributes::event_sourceAttribute::type_e'
+        UniqueName:      '.?AW4type_e at event_sourceAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           0
+            Name:            speed
+        - Kind:            LF_ENUMERATE
+          Enumerator:
+            Attrs:           3
+            Value:           1
+            Name:            size
+    - Kind:            LF_ENUM
+      Enum:
+        NumEnumerators:  2
+        Options:         [ None, Nested, HasUniqueName ]
+        FieldList:       4164
+        Name:            '__vc_attributes::event_sourceAttribute::optimize_e'
+        UniqueName:      '.?AW4optimize_e at event_sourceAttribute@__vc_attributes@@'
+        UnderlyingType:  116
+    - Kind:            LF_ARGLIST
+      ArgList:
+        ArgIndices:      [ 4163 ]
+    - Kind:            LF_POINTER
+      Pointer:
+        ReferentType:    4162
+        Attrs:           66572
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4162
+        ThisType:        4167
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  1
+        ArgumentList:    4166
+        ThisPointerAdjustment: 0
+    - Kind:            LF_MFUNCTION
+      MemberFunction:
+        ReturnType:      3
+        ClassType:       4162
+        ThisType:        4167
+        CallConv:        NearC
+        Options:         [ None, Constructor ]
+        ParameterCount:  0
+        ArgumentList:    4109
+        ThisPointerAdjustment: 0
+    - Kind:            LF_METHODLIST
+      MethodOverloadList:
+        Methods:
+          - Type:            4168
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+          - Type:            4169
+            Attrs:           3
+            VFTableOffset:   -1
+            Name:            ''
+    - Kind:            LF_FIELDLIST
+      FieldList:
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4163
+            Name:            type_e
+        - Kind:            LF_NESTTYPE
+          NestedType:
+            Type:            4165
+            Name:            optimize_e
+        - Kind:            LF_METHOD
+          OverloadedMethod:
+            NumOverloads:    2
+            MethodList:      4170
+            Name:            event_sourceAttribute
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4163
+            FieldOffset:     0
+            Name:            type
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            4165
+            FieldOffset:     4
+            Name:            optimize
+        - Kind:            LF_MEMBER
+          DataMember:
+            Attrs:           3
+            Type:            48
+            FieldOffset:     8
+            Name:            decorate
+    - Kind:            LF_STRUCTURE
+      Class:
+        MemberCount:     7
+        Options:         [ None, HasConstructorOrDestructor, ContainsNestedClass, HasUniqueName ]
+        FieldList:       4171
+        Name:            '__vc_attributes::event_sourceAttribute'
+        UniqueName:      '.?AUevent_sourceAttribute at __vc_attributes@@'
+        DerivationList:  0
+        VTableShape:     0
+        Size:            12
+...

diff  --git a/lld/test/COFF/Inputs/pdb-type-server-guid-collision-b.yaml b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-b.yaml
new file mode 100644
index 0000000000000..54e12527ae228
--- /dev/null
+++ b/lld/test/COFF/Inputs/pdb-type-server-guid-collision-b.yaml
@@ -0,0 +1,171 @@
+--- !COFF
+header:
+  Machine:         IMAGE_FILE_MACHINE_AMD64
+  Characteristics: [  ]
+sections:
+  - Name:            .drectve
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    Alignment:       1
+    SectionData:     2020202F44454641554C544C49423A224C4942434D5422202F44454641554C544C49423A224F4C444E414D45532220
+  - Name:            '.debug$S'
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    Subsections:
+      - !Symbols
+        Records:
+          - Kind:            S_OBJNAME
+            ObjNameSym:
+              Signature:       0
+              ObjectName:      'C:\Users\tobia\code\tmp\b.obj'
+          - Kind:            S_COMPILE3
+            Compile3Sym:
+              Flags:           [ SecurityChecks, HotPatch ]
+              Machine:         X64
+              FrontendMajor:   19
+              FrontendMinor:   29
+              FrontendBuild:   30140
+              FrontendQFE:     0
+              BackendMajor:    19
+              BackendMinor:    29
+              BackendBuild:    30140
+              BackendQFE:      0
+              Version:         'Microsoft (R) Optimizing Compiler'
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       __vc_attributes
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       helper_attributes
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       atl
+          - Kind:            S_UNAMESPACE
+            UsingNamespaceSym:
+              Namespace:       std
+      - !Symbols
+        Records:
+          - Kind:            S_GDATA32
+            DataSym:
+              Type:            4098
+              DisplayName:     bar_gv
+          - Kind:            S_UDT
+            UDTSym:
+              Type:            4098
+              UDTName:         Bar
+      - !StringTable
+        Strings:         []
+      - !Symbols
+        Records:
+          - Kind:            S_BUILDINFO
+            BuildInfoSym:
+              BuildId:         4122
+    Relocations:
+      - VirtualAddress:  184
+        SymbolName:      '?bar_gv@@3UBar@@A'
+        Type:            IMAGE_REL_AMD64_SECREL
+      - VirtualAddress:  188
+        SymbolName:      '?bar_gv@@3UBar@@A'
+        Type:            IMAGE_REL_AMD64_SECTION
+  - Name:            '.debug$T'
+    Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+    Alignment:       1
+    Types:
+      - Kind:            LF_TYPESERVER2
+        TypeServer2:
+          Guid:            '{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}'
+          Age:             1
+          Name:            'C:\Users\tobia\code\tmp\b.pdb'
+  - Name:            .bss
+    Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+    Alignment:       4
+    SectionData:     ''
+    SizeOfRawData:   4
+  - Name:            .chks64
+    Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]
+    SectionData:     23076615271ABF1A7B0457106301BDC96209C2204ABFB8A500000000000000000000000000000000
+symbols:
+  - Name:            '@comp.id'
+    Value:           17135036
+    SectionNumber:   -1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            '@feat.00'
+    Value:           2147549584
+    SectionNumber:   -1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            '@vol.md'
+    Value:           2
+    SectionNumber:   -1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+  - Name:            .drectve
+    Value:           0
+    SectionNumber:   1
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          47
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            '.debug$S'
+    Value:           0
+    SectionNumber:   2
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          1060
+      NumberOfRelocations: 2
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            '.debug$T'
+    Value:           0
+    SectionNumber:   3
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          60
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            .bss
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          4
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+  - Name:            '?bar_gv@@3UBar@@A'
+    Value:           0
+    SectionNumber:   4
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
+  - Name:            .chks64
+    Value:           0
+    SectionNumber:   5
+    SimpleType:      IMAGE_SYM_TYPE_NULL
+    ComplexType:     IMAGE_SYM_DTYPE_NULL
+    StorageClass:    IMAGE_SYM_CLASS_STATIC
+    SectionDefinition:
+      Length:          40
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      CheckSum:        0
+      Number:          0
+...

diff  --git a/lld/test/COFF/pdb-type-server-guid-collision-invalid.test b/lld/test/COFF/pdb-type-server-guid-collision-invalid.test
new file mode 100644
index 0000000000000..d73695577de81
--- /dev/null
+++ b/lld/test/COFF/pdb-type-server-guid-collision-invalid.test
@@ -0,0 +1,20 @@
+Check that the linker behaves when you have multiple
+PDB files with the same Guid. This was first a problem
+with Visual Studio 2022 that shipped PDB's with Guid's
+that was set to FFFFFF...
+
+RUN: rm -rf %t && mkdir -p %t && cd %t
+RUN: yaml2obj %p/Inputs/pdb-type-server-guid-collision-a.yaml -o a.obj
+RUN: yaml2obj %p/Inputs/pdb-type-server-guid-collision-b.yaml -o b.obj
+RUN: llvm-pdbutil yaml2pdb %S/Inputs/pdb-type-server-guid-collision-a-pdb.yaml -pdb a.pdb
+RUN: llvm-pdbutil yaml2pdb %S/Inputs/pdb-type-server-guid-collision-b-pdb.yaml -pdb b.pdb
+RUN: lld-link a.obj b.obj -out:collision.dll /debug:ghash -pdb:collision.pdb -nodefaultlib /noentry /dll
+RUN: lld-link a.obj b.obj -out:collision.dll /debug:noghash -pdb:collision_noghash.pdb -nodefaultlib /noentry /dll
+RUN: llvm-pdbutil dump -globals collision.pdb | FileCheck %s
+RUN: llvm-pdbutil dump -globals collision_noghash.pdb | FileCheck %s
+
+CHECK-LABEL:                       Global Symbols
+CHECK:       ============================================================
+
+CHECK:     100 | S_GDATA32 [size = 24] `bar_gv`
+CHECK-NEXT:           type = 0x104E (Bar), addr = 0002:0004

diff  --git a/lld/test/COFF/pdb-type-server-guid-collision-valid.test b/lld/test/COFF/pdb-type-server-guid-collision-valid.test
new file mode 100644
index 0000000000000..115168c4cf79b
--- /dev/null
+++ b/lld/test/COFF/pdb-type-server-guid-collision-valid.test
@@ -0,0 +1,19 @@
+Check that the linker behaves when you have multiple
+PDB files with the same Guid. This checks the case
+where the Guids are duplicates but not invalid (i.e. not FFFFFF)
+
+RUN: rm -rf %t && mkdir -p %t && cd %t
+RUN: sed s/{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}/{6C633EB7-46FE-4609-BA83-EB820E6F5683}/ %S/Inputs/pdb-type-server-guid-collision-a.yaml | yaml2obj > a.obj
+RUN: sed s/{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}/{6C633EB7-46FE-4609-BA83-EB820E6F5683}/ %S/Inputs/pdb-type-server-guid-collision-b.yaml | yaml2obj > b.obj
+RUN: sed s/{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}/{6C633EB7-46FE-4609-BA83-EB820E6F5683}/ %S/Inputs/pdb-type-server-guid-collision-a-pdb.yaml | llvm-pdbutil yaml2pdb - -pdb a.pdb
+RUN: sed s/{FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}/{6C633EB7-46FE-4609-BA83-EB820E6F5683}/ %S/Inputs/pdb-type-server-guid-collision-b-pdb.yaml | llvm-pdbutil yaml2pdb - -pdb b.pdb
+RUN: lld-link a.obj b.obj -out:collision.dll -debug -pdb:collision.pdb -nodefaultlib /noentry /dll -verbose 2>&1 | FileCheck %s -check-prefix LOG
+RUN: llvm-pdbutil dump -globals collision.pdb | FileCheck %s -check-prefix DUMP
+
+LOG: lld-link: GUID collision between b.pdb and a.pdb
+
+DUMP-LABEL:                       Global Symbols
+DUMP:       ============================================================
+
+DUMP:     100 | S_GDATA32 [size = 24] `bar_gv`
+DUMP-NEXT:           type = 0x104E (Bar), addr = 0002:0004


        


More information about the llvm-commits mailing list