Index: lld/trunk/COFF/PDB.cpp =================================================================== --- lld/trunk/COFF/PDB.cpp +++ lld/trunk/COFF/PDB.cpp @@ -205,8 +205,8 @@ DebugH = DebugH.drop_front(sizeof(object::debug_h_header)); return Header->Magic == COFF::DEBUG_HASHES_SECTION_MAGIC && Header->Version == 0 && - Header->HashAlgorithm == uint16_t(GlobalTypeHashAlg::SHA1) && - (DebugH.size() % 20 == 0); + Header->HashAlgorithm == uint16_t(GlobalTypeHashAlg::SHA1_8) && + (DebugH.size() % 8 == 0); } static Optional> getDebugH(ObjFile *File) { Index: lld/trunk/test/COFF/Inputs/pdb-hashes-1.yaml =================================================================== --- lld/trunk/test/COFF/Inputs/pdb-hashes-1.yaml +++ lld/trunk/test/COFF/Inputs/pdb-hashes-1.yaml @@ -1,13 +1,13 @@ --- !COFF -header: +header: Machine: IMAGE_FILE_MACHINE_I386 Characteristics: [ ] -sections: +sections: - Name: .text Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] Alignment: 16 SectionData: 5589E55683EC188B450C8B4D08C745F8000000008B55088D75F4894DF089F18914248945ECE80000000083EC048D4DF4890C248945E8E80000000083C4185E5DC3 - Relocations: + Relocations: - VirtualAddress: 38 SymbolName: '??0Foo@NS@@QAE@H@Z' Type: IMAGE_REL_I386_REL32 @@ -33,12 +33,12 @@ - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F5000000840000000000000000000000410000000000000008000000000000004400000007000000040000000100000040000000000000000800000000000000710000000600040000000000030000003E000000000000000800000000000000AF0000000400040000000000040000003D000000000000000800000000000000EC0000000300080000000000F1000000960000002A00471100000000000000000000000041000000000000000000000003100000000000000000006D61696E000D003E1174000000010061726763001200451116000000080000001400000000002D000D003E11001000000100617267760012004511160000000C0000001400000000002D000A003E1109100000000066001200451116000000F4FFFFFF1400000000002D0002004F110000F200000030000000000000000000000041000000000000000300000024000000000000000400000014000000050000002D00000006000000F1000000100000000E000811091000004E533A3A466F6F00F4000000300000000100000010013469AC0DCAB9F1D7ED0FC4FA74E3983A0000240000001001C6036A3E7D29B0AB68FEE19A35B11BCD0000F30000003C01000000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A312E63707000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A2E6800245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D2024657369202454302038202D205E203D20000000 - Subsections: + SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F50000008400000000000000000000004100000000000000080000000000000052000000070000000400000001000000400000000000000008000000000000007F0000000600040000000000030000003E000000000000000800000000000000BD0000000400040000000000040000003D000000000000000800000000000000FA0000000300080000000000F1000000960000002A00471100000000000000000000000041000000000000000000000003100000000000000000006D61696E000D003E1174000000010061726763001200451116000000080000001400000000002D000D003E11001000000100617267760012004511160000000C0000001400000000002D000A003E1109100000000066001200451116000000F4FFFFFF1400000000002D0002004F110000F200000030000000000000000000000041000000000000000300000024000000000000000300000014000000040000002D00000005000000F1000000100000000E000811091000004E533A3A466F6F00F40000003000000001000000100165C9E387F88362A8EB2B49539DD5A65500002B0000001001D3AE9D06B0C1F06ABE75A0557053ED6B0000F30000004801000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A312E63707000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A2E6800245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D2024657369202454302038202D205E203D2000 + Subsections: - !Symbols - Records: + Records: - Kind: S_COMPILE3 - Compile3Sym: + Compile3Sym: Flags: [ ] Machine: Pentium3 FrontendMajor: 7 @@ -51,7 +51,7 @@ BackendQFE: 0 Version: 'clang version 7.0.0 ' - !FrameData - Frames: + Frames: - CodeSize: 65 FrameFunc: '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' LocalSize: 0 @@ -85,9 +85,9 @@ RvaStart: 4 SavedRegsSize: 8 - !Symbols - Records: + Records: - Kind: S_GPROC32_ID - ProcSym: + ProcSym: CodeSize: 65 DbgStart: 0 DbgEnd: 0 @@ -95,98 +95,96 @@ Flags: [ ] DisplayName: main - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 116 Flags: [ IsParameter ] VarName: argc - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: 8 - Range: + Range: OffsetStart: 20 ISectStart: 0 Range: 45 - Gaps: + Gaps: - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 4096 Flags: [ IsParameter ] VarName: argv - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: 12 - Range: + Range: OffsetStart: 20 ISectStart: 0 Range: 45 - Gaps: + Gaps: - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 4105 Flags: [ ] VarName: f - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: -12 - Range: + Range: OffsetStart: 20 ISectStart: 0 Range: 45 - Gaps: + Gaps: - Kind: S_PROC_ID_END - ScopeEndSym: + ScopeEndSym: - !Lines CodeSize: 65 Flags: [ ] RelocOffset: 0 RelocSegment: 0 - Blocks: - - FileName: 'C:\src\llvm-project\build\obj1.cpp' - Lines: + Blocks: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj1.cpp' + Lines: - Offset: 0 - LineStart: 4 + LineStart: 3 IsStatement: false EndDelta: 0 - Offset: 20 - LineStart: 5 + LineStart: 4 IsStatement: false EndDelta: 0 - Offset: 45 - LineStart: 6 + LineStart: 5 IsStatement: false EndDelta: 0 - Columns: + Columns: - !Symbols - Records: + Records: - Kind: S_UDT - UDTSym: + UDTSym: Type: 4105 UDTName: 'NS::Foo' - !FileChecksums - Checksums: - - FileName: 'C:\src\llvm-project\build\obj1.cpp' + Checksums: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj1.cpp' Kind: MD5 - Checksum: 3469AC0DCAB9F1D7ED0FC4FA74E3983A - - FileName: 'C:\src\llvm-project\build\obj.h' + Checksum: 65C9E387F88362A8EB2B49539DD5A655 + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj.h' Kind: MD5 - Checksum: C6036A3E7D29B0AB68FEE19A35B11BCD + Checksum: D3AE9D06B0C1F06ABE75A0557053ED6B - !StringTable - Strings: - - 'C:\src\llvm-project\build\obj1.cpp' - - 'C:\src\llvm-project\build\obj.h' + Strings: + - 'D:\src\llvmbuild\clang\Debug\x86\obj1.cpp' + - 'D:\src\llvmbuild\clang\Debug\x86\obj.h' - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = ' - '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = ' - '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = $esi $T0 8 - ^ = ' - - '' - - '' - Relocations: + Relocations: - VirtualAddress: 68 SymbolName: _main Type: IMAGE_REL_I386_DIR32NB @@ -223,29 +221,29 @@ - Name: '.debug$T' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 040000000A000210700400000A8000000E0001120200000074000000001000000E0008107400000000000200011000001200011600000000021000006D61696E00F3F2F12A0005150000800200000000000000000000000000004E533A3A466F6F002E3F4155466F6F404E53404000F10A000210041000000A8000000A00011201000000740000001A0009100300000004100000051000000B00010006100000000000001A0003120D15030074000000000058001115030007100000466F6F002A0005150200000208100000000000000000000004004E533A3A466F6F002E3F4155466F6F404E53404000F12600051600000000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A2E68000E000616091000000A100000030000000E0002160410000007100000466F6F00 - Types: + SectionData: 040000000A000210700400000A8000000E0001120200000074000000001000000E0008107400000000000200011000001200011600000000021000006D61696E00F3F2F12A0005150000800200000000000000000000000000004E533A3A466F6F002E3F4155466F6F404E53404000F10A000210041000000A8000000A00011201000000740000001A0009100300000004100000051000000B00010006100000000000001A0003120D15030074000000000058001115030007100000466F6F002A0005150200000208100000000000000000000004004E533A3A466F6F002E3F4155466F6F404E53404000F12E00051600000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A2E6800F10E000616091000000A100000020000000E0002160410000007100000466F6F00 + Types: - Kind: LF_POINTER - Pointer: + Pointer: ReferentType: 1136 Attrs: 32778 - Kind: LF_ARGLIST - ArgList: + ArgList: ArgIndices: [ 116, 4096 ] - Kind: LF_PROCEDURE - Procedure: + Procedure: ReturnType: 116 CallConv: NearC Options: [ None ] ParameterCount: 2 ArgumentList: 4097 - Kind: LF_FUNC_ID - FuncId: + FuncId: ParentScope: 0 FunctionType: 4098 Name: main - Kind: LF_STRUCTURE - Class: + Class: MemberCount: 0 Options: [ None, ForwardReference, HasUniqueName ] FieldList: 0 @@ -255,14 +253,14 @@ VTableShape: 0 Size: 0 - Kind: LF_POINTER - Pointer: + Pointer: ReferentType: 4100 Attrs: 32778 - Kind: LF_ARGLIST - ArgList: + ArgList: ArgIndices: [ 116 ] - Kind: LF_MFUNCTION - MemberFunction: + MemberFunction: ReturnType: 3 ClassType: 4100 ThisType: 4101 @@ -272,21 +270,21 @@ ArgumentList: 4102 ThisPointerAdjustment: 0 - Kind: LF_FIELDLIST - FieldList: + FieldList: - Kind: LF_MEMBER - DataMember: + DataMember: Attrs: 3 Type: 116 FieldOffset: 0 Name: X - Kind: LF_ONEMETHOD - OneMethod: + OneMethod: Type: 4103 Attrs: 3 VFTableOffset: -1 Name: Foo - Kind: LF_STRUCTURE - Class: + Class: MemberCount: 2 Options: [ None, HasUniqueName ] FieldList: 4104 @@ -296,47 +294,47 @@ VTableShape: 0 Size: 4 - Kind: LF_STRING_ID - StringId: + StringId: Id: 0 - String: 'C:\src\llvm-project\build\obj.h' + String: 'D:\src\llvmbuild\clang\Debug\x86\obj.h' - Kind: LF_UDT_SRC_LINE - UdtSourceLine: + UdtSourceLine: UDT: 4105 SourceFile: 4106 - LineNumber: 3 + LineNumber: 2 - Kind: LF_MFUNC_ID - MemberFuncId: + MemberFuncId: ClassType: 4100 FunctionType: 4103 Name: Foo - Name: '.debug$H' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: C5C9330100000000624A7FEE7323656B7F1C5A63800309EE1ED8BB5B0EB2C87AD629AA9E5C98B7A3ED69DB1355707DF1624E463ACE08649D0FC35F163E20CC43089ADCA64B712C03EDA4CB88537EBAE4005A09006A9FB389476700689419512EFB395F1A23ADA4E788EB7A90DA146E89F004E6185E87867C58B4AC836CBBD1301D1BC1BDEEB7F3A86BB7ECCF6632585CDC7606E4CCAB0C6E6E190E3091E4290AFF7BA25E9E8209892CA91CCBF55A49FCB303335DC553B426E3AC635C1883F35475E9A4A12ED6396BC795E5D801DB74B371743A7A9E69529643FB49E2201DD99ECA4F72B2213D30B9768BAE6EB7C1150155B4421347349E771F26985B869638BAA4FE40A80C07611AAF09B6A4 - GlobalHashes: + SectionData: C5C9330100000100800309EE1ED8BB5B5397319F1CC14E2CDF04AA3125BBC50E95CEBA304A2C449323ADA4E788EB7A90B5DECADF1A832BA46632585CDC7606E4B97B86241E5F45B0BCD2406E22465E11A528BEF0A7F589C76079F1186C40C2165091EFEBD5B5446B26FFBFD620CFB362 + GlobalHashes: Version: 0 - HashAlgorithm: 0 - HashValues: - - 624A7FEE7323656B7F1C5A63800309EE1ED8BB5B - - 0EB2C87AD629AA9E5C98B7A3ED69DB1355707DF1 - - 624E463ACE08649D0FC35F163E20CC43089ADCA6 - - 4B712C03EDA4CB88537EBAE4005A09006A9FB389 - - 476700689419512EFB395F1A23ADA4E788EB7A90 - - DA146E89F004E6185E87867C58B4AC836CBBD130 - - 1D1BC1BDEEB7F3A86BB7ECCF6632585CDC7606E4 - - CCAB0C6E6E190E3091E4290AFF7BA25E9E820989 - - 2CA91CCBF55A49FCB303335DC553B426E3AC635C - - 1883F35475E9A4A12ED6396BC795E5D801DB74B3 - - 71743A7A9E69529643FB49E2201DD99ECA4F72B2 - - 213D30B9768BAE6EB7C1150155B4421347349E77 - - 1F26985B869638BAA4FE40A80C07611AAF09B6A4 + HashAlgorithm: 1 + HashValues: + - 800309EE1ED8BB5B + - 5397319F1CC14E2C + - DF04AA3125BBC50E + - 95CEBA304A2C4493 + - 23ADA4E788EB7A90 + - B5DECADF1A832BA4 + - 6632585CDC7606E4 + - B97B86241E5F45B0 + - BCD2406E22465E11 + - A528BEF0A7F589C7 + - 6079F1186C40C216 + - 5091EFEBD5B5446B + - 26FFBFD620CFB362 - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 04000000F500000064000000000000000000000020000000000000000400000000000000440000000600000004000000010000001F000000000000000400000000000000710000000500040000000000030000001D000000000000000400000000000000AF0000000300040000000000F10000007B000000320047110000000000000000000000002000000000000000000000000C100000000000000000004E533A3A466F6F3A3A466F6F000D003E1105100000010074686973001200451116000000FCFFFFFF0F000000000011000A003E1174000000010078001200451116000000080000000F0000000000110002004F1100F2000000200000000000000000000000200000001800000001000000140000000000000004000000 - Subsections: + SectionData: 04000000F500000064000000000000000000000020000000000000000400000000000000520000000600000004000000010000001F0000000000000004000000000000007F0000000500040000000000030000001D000000000000000400000000000000BD0000000300040000000000F10000007B000000320047110000000000000000000000002000000000000000000000000C100000000000000000004E533A3A466F6F3A3A466F6F000D003E1105100000010074686973001200451116000000FCFFFFFF0F000000000011000A003E1174000000010078001200451116000000080000000F0000000000110002004F1100F2000000200000000000000000000000200000001800000001000000140000000000000003000000 + Subsections: - !FrameData - Frames: + Frames: - CodeSize: 32 FrameFunc: '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' LocalSize: 0 @@ -362,9 +360,9 @@ RvaStart: 3 SavedRegsSize: 4 - !Symbols - Records: + Records: - Kind: S_GPROC32_ID - ProcSym: + ProcSym: CodeSize: 32 DbgStart: 0 DbgEnd: 0 @@ -372,51 +370,51 @@ Flags: [ ] DisplayName: 'NS::Foo::Foo' - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 4101 Flags: [ IsParameter ] VarName: this - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: -4 - Range: + Range: OffsetStart: 15 ISectStart: 0 Range: 17 - Gaps: + Gaps: - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 116 Flags: [ IsParameter ] VarName: x - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: 8 - Range: + Range: OffsetStart: 15 ISectStart: 0 Range: 17 - Gaps: + Gaps: - Kind: S_PROC_ID_END - ScopeEndSym: + ScopeEndSym: - !Lines CodeSize: 32 Flags: [ ] RelocOffset: 0 RelocSegment: 0 - Blocks: - - FileName: 'C:\src\llvm-project\build\obj.h' - Lines: + Blocks: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj.h' + Lines: - Offset: 0 - LineStart: 4 + LineStart: 3 IsStatement: false EndDelta: 0 - Columns: - Relocations: + Columns: + Relocations: - VirtualAddress: 12 SymbolName: '??0Foo@NS@@QAE@H@Z' Type: IMAGE_REL_I386_DIR32NB @@ -444,14 +442,14 @@ - VirtualAddress: 256 SymbolName: '??0Foo@NS@@QAE@H@Z' Type: IMAGE_REL_I386_SECTION -symbols: +symbols: - Name: .text Value: 0 SectionNumber: 1 SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 65 NumberOfRelocations: 2 NumberOfLinenumbers: 0 @@ -463,7 +461,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 0 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -475,7 +473,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 0 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -487,7 +485,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 32 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -506,7 +504,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 48 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -518,11 +516,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 820 + SectionDefinition: + Length: 832 NumberOfRelocations: 11 NumberOfLinenumbers: 0 - CheckSum: 3821266521 + CheckSum: 372945565 Number: 6 - Name: '.debug$S' Value: 0 @@ -530,11 +528,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 284 NumberOfRelocations: 9 NumberOfLinenumbers: 0 - CheckSum: 112499332 + CheckSum: 1378739251 Number: 4 Selection: IMAGE_COMDAT_SELECT_ASSOCIATIVE - Name: '.debug$T' @@ -543,11 +541,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 308 + SectionDefinition: + Length: 316 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 2028313836 + CheckSum: 3343977630 Number: 7 - Name: '.debug$H' Value: 0 @@ -555,11 +553,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 268 + SectionDefinition: + Length: 112 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 1115012461 + CheckSum: 1535721080 Number: 8 - Name: '@feat.00' Value: 1 Index: lld/trunk/test/COFF/Inputs/pdb-hashes-2-missing.yaml =================================================================== --- lld/trunk/test/COFF/Inputs/pdb-hashes-2-missing.yaml +++ lld/trunk/test/COFF/Inputs/pdb-hashes-2-missing.yaml @@ -1,8 +1,8 @@ --- !COFF -header: +header: Machine: IMAGE_FILE_MACHINE_I386 Characteristics: [ ] -sections: +sections: - Name: .text Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] Alignment: 16 @@ -22,12 +22,12 @@ - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F500000064000000000000000000000019000000000000000400000000000000240000000400000004000000010000001800000000000000040000000000000051000000030004000000000003000000160000000000000004000000000000008F0000000100040000000000F1000000540000002E0047110000000000000000000000001900000000000000000000000D100000000000000000004E533A3A66756E63000A003E110310000001006600120045111600000008000000070000000000120002004F11F20000002800000000000000000000001900000000000000020000001C00000000000000040000000700000005000000F1000000100000000E0008110A1000004E533A3A466F6F00F400000018000000010000001001CEC8BDE31D126291115B63CE08A5D1360000F3000000CC00000000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A322E63707000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D2000 - Subsections: + SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F5000000640000000000000000000000190000000000000004000000000000002B000000040000000400000001000000180000000000000004000000000000005800000003000400000000000300000016000000000000000400000000000000960000000100040000000000F1000000540000002E0047110000000000000000000000001900000000000000000000000D100000000000000000004E533A3A66756E63000A003E110310000001006600120045111600000008000000070000000000120002004F11F20000002800000000000000000000001900000000000000020000001C00000000000000030000000700000004000000F1000000100000000E0008110A1000004E533A3A466F6F00F40000001800000001000000100159DFAC75D18675AED1AD169FE316317E0000F3000000D400000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A322E63707000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200000 + Subsections: - !Symbols - Records: + Records: - Kind: S_COMPILE3 - Compile3Sym: + Compile3Sym: Flags: [ ] Machine: Pentium3 FrontendMajor: 7 @@ -40,7 +40,7 @@ BackendQFE: 0 Version: 'clang version 7.0.0 ' - !FrameData - Frames: + Frames: - CodeSize: 25 FrameFunc: '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' LocalSize: 0 @@ -66,9 +66,9 @@ RvaStart: 3 SavedRegsSize: 4 - !Symbols - Records: + Records: - Kind: S_GPROC32_ID - ProcSym: + ProcSym: CodeSize: 25 DbgStart: 0 DbgEnd: 0 @@ -76,57 +76,58 @@ Flags: [ ] DisplayName: 'NS::func' - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 4099 Flags: [ IsParameter ] VarName: f - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: 8 - Range: + Range: OffsetStart: 7 ISectStart: 0 Range: 18 - Gaps: + Gaps: - Kind: S_PROC_ID_END - ScopeEndSym: + ScopeEndSym: - !Lines CodeSize: 25 Flags: [ ] RelocOffset: 0 RelocSegment: 0 - Blocks: - - FileName: 'C:\src\llvm-project\build\obj2.cpp' - Lines: + Blocks: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj2.cpp' + Lines: - Offset: 0 - LineStart: 4 + LineStart: 3 IsStatement: false EndDelta: 0 - Offset: 7 - LineStart: 5 + LineStart: 4 IsStatement: false EndDelta: 0 - Columns: + Columns: - !Symbols - Records: + Records: - Kind: S_UDT - UDTSym: + UDTSym: Type: 4106 UDTName: 'NS::Foo' - !FileChecksums - Checksums: - - FileName: 'C:\src\llvm-project\build\obj2.cpp' + Checksums: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj2.cpp' Kind: MD5 - Checksum: CEC8BDE31D126291115B63CE08A5D136 + Checksum: 59DFAC75D18675AED1AD169FE316317E - !StringTable - Strings: - - 'C:\src\llvm-project\build\obj2.cpp' + Strings: + - 'D:\src\llvmbuild\clang\Debug\x86\obj2.cpp' - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = ' - '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = ' - Relocations: + - '' + Relocations: - VirtualAddress: 68 SymbolName: '?func@NS@@YAHABUFoo@1@@Z' Type: IMAGE_REL_I386_DIR32NB @@ -151,14 +152,14 @@ - Name: '.debug$T' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 040000000A000516000000004E5300F12A0005150000800200000000000000000000000000004E533A3A466F6F002E3F4155466F6F404E53404000F10A000110011000000100F2F10A000210021000002A8000000A00011201000000031000000E0008107400000000000100041000000A000210011000000A8000000A00011201000000740000001A0009100300000001100000061000000B00010007100000000000001A0003120D15030074000000000058001115030008100000466F6F002A0005150200000209100000000000000000000004004E533A3A466F6F002E3F4155466F6F404E53404000F12600051600000000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A2E68000E0006160A1000000B1000000300000012000116001000000510000066756E6300F3F2F1 - Types: + SectionData: 040000000A000516000000004E5300F12A0005150000800200000000000000000000000000004E533A3A466F6F002E3F4155466F6F404E53404000F10A000110011000000100F2F10A000210021000002A8000000A00011201000000031000000E0008107400000000000100041000000A000210011000000A8000000A00011201000000740000001A0009100300000001100000061000000B00010007100000000000001A0003120D15030074000000000058001115030008100000466F6F002A0005150200000209100000000000000000000004004E533A3A466F6F002E3F4155466F6F404E53404000F12E00051600000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A2E6800F10E0006160A1000000B1000000200000012000116001000000510000066756E6300F3F2F1 + Types: - Kind: LF_STRING_ID - StringId: + StringId: Id: 0 String: NS - Kind: LF_STRUCTURE - Class: + Class: MemberCount: 0 Options: [ None, ForwardReference, HasUniqueName ] FieldList: 0 @@ -168,32 +169,32 @@ VTableShape: 0 Size: 0 - Kind: LF_MODIFIER - Modifier: + Modifier: ModifiedType: 4097 Modifiers: [ None, Const ] - Kind: LF_POINTER - Pointer: + Pointer: ReferentType: 4098 Attrs: 32810 - Kind: LF_ARGLIST - ArgList: + ArgList: ArgIndices: [ 4099 ] - Kind: LF_PROCEDURE - Procedure: + Procedure: ReturnType: 116 CallConv: NearC Options: [ None ] ParameterCount: 1 ArgumentList: 4100 - Kind: LF_POINTER - Pointer: + Pointer: ReferentType: 4097 Attrs: 32778 - Kind: LF_ARGLIST - ArgList: + ArgList: ArgIndices: [ 116 ] - Kind: LF_MFUNCTION - MemberFunction: + MemberFunction: ReturnType: 3 ClassType: 4097 ThisType: 4102 @@ -203,21 +204,21 @@ ArgumentList: 4103 ThisPointerAdjustment: 0 - Kind: LF_FIELDLIST - FieldList: + FieldList: - Kind: LF_MEMBER - DataMember: + DataMember: Attrs: 3 Type: 116 FieldOffset: 0 Name: X - Kind: LF_ONEMETHOD - OneMethod: + OneMethod: Type: 4104 Attrs: 3 VFTableOffset: -1 Name: Foo - Kind: LF_STRUCTURE - Class: + Class: MemberCount: 2 Options: [ None, HasUniqueName ] FieldList: 4105 @@ -227,27 +228,27 @@ VTableShape: 0 Size: 4 - Kind: LF_STRING_ID - StringId: + StringId: Id: 0 - String: 'C:\src\llvm-project\build\obj.h' + String: 'D:\src\llvmbuild\clang\Debug\x86\obj.h' - Kind: LF_UDT_SRC_LINE - UdtSourceLine: + UdtSourceLine: UDT: 4106 SourceFile: 4107 - LineNumber: 3 + LineNumber: 2 - Kind: LF_FUNC_ID - FuncId: + FuncId: ParentScope: 4096 FunctionType: 4101 Name: func -symbols: +symbols: - Name: .text Value: 0 SectionNumber: 1 SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 25 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -259,7 +260,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 0 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -271,7 +272,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 0 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -283,7 +284,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 48 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -295,11 +296,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 576 + SectionDefinition: + Length: 584 NumberOfRelocations: 7 NumberOfLinenumbers: 0 - CheckSum: 1275848292 + CheckSum: 917356735 Number: 5 - Name: '.debug$T' Value: 0 @@ -307,11 +308,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 312 + SectionDefinition: + Length: 320 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 3001708198 + CheckSum: 2684556216 Number: 6 - Name: '@feat.00' Value: 1 Index: lld/trunk/test/COFF/Inputs/pdb-hashes-2.yaml =================================================================== --- lld/trunk/test/COFF/Inputs/pdb-hashes-2.yaml +++ lld/trunk/test/COFF/Inputs/pdb-hashes-2.yaml @@ -1,8 +1,8 @@ --- !COFF -header: +header: Machine: IMAGE_FILE_MACHINE_I386 Characteristics: [ ] -sections: +sections: - Name: .text Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] Alignment: 16 @@ -22,12 +22,12 @@ - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F500000064000000000000000000000019000000000000000400000000000000240000000400000004000000010000001800000000000000040000000000000051000000030004000000000003000000160000000000000004000000000000008F0000000100040000000000F1000000540000002E0047110000000000000000000000001900000000000000000000000D100000000000000000004E533A3A66756E63000A003E110310000001006600120045111600000008000000070000000000120002004F11F20000002800000000000000000000001900000000000000020000001C00000000000000040000000700000005000000F1000000100000000E0008110A1000004E533A3A466F6F00F400000018000000010000001001CEC8BDE31D126291115B63CE08A5D1360000F3000000CC00000000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A322E63707000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D2000 - Subsections: + SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F5000000640000000000000000000000190000000000000004000000000000002B000000040000000400000001000000180000000000000004000000000000005800000003000400000000000300000016000000000000000400000000000000960000000100040000000000F1000000540000002E0047110000000000000000000000001900000000000000000000000D100000000000000000004E533A3A66756E63000A003E110310000001006600120045111600000008000000070000000000120002004F11F20000002800000000000000000000001900000000000000020000001C00000000000000030000000700000004000000F1000000100000000E0008110A1000004E533A3A466F6F00F40000001800000001000000100159DFAC75D18675AED1AD169FE316317E0000F3000000D400000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A322E63707000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200000 + Subsections: - !Symbols - Records: + Records: - Kind: S_COMPILE3 - Compile3Sym: + Compile3Sym: Flags: [ ] Machine: Pentium3 FrontendMajor: 7 @@ -40,7 +40,7 @@ BackendQFE: 0 Version: 'clang version 7.0.0 ' - !FrameData - Frames: + Frames: - CodeSize: 25 FrameFunc: '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' LocalSize: 0 @@ -66,9 +66,9 @@ RvaStart: 3 SavedRegsSize: 4 - !Symbols - Records: + Records: - Kind: S_GPROC32_ID - ProcSym: + ProcSym: CodeSize: 25 DbgStart: 0 DbgEnd: 0 @@ -76,57 +76,58 @@ Flags: [ ] DisplayName: 'NS::func' - Kind: S_LOCAL - LocalSym: + LocalSym: Type: 4099 Flags: [ IsParameter ] VarName: f - Kind: S_DEFRANGE_REGISTER_REL - DefRangeRegisterRelSym: + DefRangeRegisterRelSym: Register: 22 Flags: 0 BasePointerOffset: 8 - Range: + Range: OffsetStart: 7 ISectStart: 0 Range: 18 - Gaps: + Gaps: - Kind: S_PROC_ID_END - ScopeEndSym: + ScopeEndSym: - !Lines CodeSize: 25 Flags: [ ] RelocOffset: 0 RelocSegment: 0 - Blocks: - - FileName: 'C:\src\llvm-project\build\obj2.cpp' - Lines: + Blocks: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj2.cpp' + Lines: - Offset: 0 - LineStart: 4 + LineStart: 3 IsStatement: false EndDelta: 0 - Offset: 7 - LineStart: 5 + LineStart: 4 IsStatement: false EndDelta: 0 - Columns: + Columns: - !Symbols - Records: + Records: - Kind: S_UDT - UDTSym: + UDTSym: Type: 4106 UDTName: 'NS::Foo' - !FileChecksums - Checksums: - - FileName: 'C:\src\llvm-project\build\obj2.cpp' + Checksums: + - FileName: 'D:\src\llvmbuild\clang\Debug\x86\obj2.cpp' Kind: MD5 - Checksum: CEC8BDE31D126291115B63CE08A5D136 + Checksum: 59DFAC75D18675AED1AD169FE316317E - !StringTable - Strings: - - 'C:\src\llvm-project\build\obj2.cpp' + Strings: + - 'D:\src\llvmbuild\clang\Debug\x86\obj2.cpp' - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = ' - '$T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = ' - '$T0 $ebp 4 + = $eip $T0 ^ = $esp $T0 4 + = $ebp $T0 4 - ^ = ' - Relocations: + - '' + Relocations: - VirtualAddress: 68 SymbolName: '?func@NS@@YAHABUFoo@1@@Z' Type: IMAGE_REL_I386_DIR32NB @@ -151,14 +152,14 @@ - Name: '.debug$T' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 040000000A000516000000004E5300F12A0005150000800200000000000000000000000000004E533A3A466F6F002E3F4155466F6F404E53404000F10A000110011000000100F2F10A000210021000002A8000000A00011201000000031000000E0008107400000000000100041000000A000210011000000A8000000A00011201000000740000001A0009100300000001100000061000000B00010007100000000000001A0003120D15030074000000000058001115030008100000466F6F002A0005150200000209100000000000000000000004004E533A3A466F6F002E3F4155466F6F404E53404000F12600051600000000433A5C7372635C6C6C766D2D70726F6A6563745C6275696C645C6F626A2E68000E0006160A1000000B1000000300000012000116001000000510000066756E6300F3F2F1 - Types: + SectionData: 040000000A000516000000004E5300F12A0005150000800200000000000000000000000000004E533A3A466F6F002E3F4155466F6F404E53404000F10A000110011000000100F2F10A000210021000002A8000000A00011201000000031000000E0008107400000000000100041000000A000210011000000A8000000A00011201000000740000001A0009100300000001100000061000000B00010007100000000000001A0003120D15030074000000000058001115030008100000466F6F002A0005150200000209100000000000000000000004004E533A3A466F6F002E3F4155466F6F404E53404000F12E00051600000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A2E6800F10E0006160A1000000B1000000200000012000116001000000510000066756E6300F3F2F1 + Types: - Kind: LF_STRING_ID - StringId: + StringId: Id: 0 String: NS - Kind: LF_STRUCTURE - Class: + Class: MemberCount: 0 Options: [ None, ForwardReference, HasUniqueName ] FieldList: 0 @@ -168,32 +169,32 @@ VTableShape: 0 Size: 0 - Kind: LF_MODIFIER - Modifier: + Modifier: ModifiedType: 4097 Modifiers: [ None, Const ] - Kind: LF_POINTER - Pointer: + Pointer: ReferentType: 4098 Attrs: 32810 - Kind: LF_ARGLIST - ArgList: + ArgList: ArgIndices: [ 4099 ] - Kind: LF_PROCEDURE - Procedure: + Procedure: ReturnType: 116 CallConv: NearC Options: [ None ] ParameterCount: 1 ArgumentList: 4100 - Kind: LF_POINTER - Pointer: + Pointer: ReferentType: 4097 Attrs: 32778 - Kind: LF_ARGLIST - ArgList: + ArgList: ArgIndices: [ 116 ] - Kind: LF_MFUNCTION - MemberFunction: + MemberFunction: ReturnType: 3 ClassType: 4097 ThisType: 4102 @@ -203,21 +204,21 @@ ArgumentList: 4103 ThisPointerAdjustment: 0 - Kind: LF_FIELDLIST - FieldList: + FieldList: - Kind: LF_MEMBER - DataMember: + DataMember: Attrs: 3 Type: 116 FieldOffset: 0 Name: X - Kind: LF_ONEMETHOD - OneMethod: + OneMethod: Type: 4104 Attrs: 3 VFTableOffset: -1 Name: Foo - Kind: LF_STRUCTURE - Class: + Class: MemberCount: 2 Options: [ None, HasUniqueName ] FieldList: 4105 @@ -227,49 +228,49 @@ VTableShape: 0 Size: 4 - Kind: LF_STRING_ID - StringId: + StringId: Id: 0 - String: 'C:\src\llvm-project\build\obj.h' + String: 'D:\src\llvmbuild\clang\Debug\x86\obj.h' - Kind: LF_UDT_SRC_LINE - UdtSourceLine: + UdtSourceLine: UDT: 4106 SourceFile: 4107 - LineNumber: 3 + LineNumber: 2 - Kind: LF_FUNC_ID - FuncId: + FuncId: ParentScope: 4096 FunctionType: 4101 Name: func - Name: '.debug$H' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: C5C9330100000000D6242F1ED02B98E973DCA3334A061540B751965F476700689419512EFB395F1A23ADA4E788EB7A90DC6D1D00D355FEFEDDE4C68641D053622767E1526FD137C1525BDF80D746B3B9C314372C738054FC95D47092AC4D20BAC80E167B185331D42B388FB966A52D778FFF3829DC925A33C5CA6DD9A3EBA965DA146E89F004E6185E87867C58B4AC836CBBD1301D1BC1BDEEB7F3A86BB7ECCF6632585CDC7606E4CCAB0C6E6E190E3091E4290AFF7BA25E9E8209892CA91CCBF55A49FCB303335DC553B426E3AC635C1883F35475E9A4A12ED6396BC795E5D801DB74B371743A7A9E69529643FB49E2201DD99ECA4F72B2213D30B9768BAE6EB7C1150155B4421347349E77B1F380BB197127A54D0DB470E57DF96B15066C78 - GlobalHashes: + SectionData: C5C93301000001004A061540B751965F23ADA4E788EB7A9032673B3BABE3CA5356B1521BDAE4BEA70661C95750D0206E896FB09488EE8E1BB5DECADF1A832BA46632585CDC7606E4B97B86241E5F45B0BCD2406E22465E11A528BEF0A7F589C76079F1186C40C2165091EFEBD5B5446B5AAD8721C21DF3E6 + GlobalHashes: Version: 0 - HashAlgorithm: 0 - HashValues: - - D6242F1ED02B98E973DCA3334A061540B751965F - - 476700689419512EFB395F1A23ADA4E788EB7A90 - - DC6D1D00D355FEFEDDE4C68641D053622767E152 - - 6FD137C1525BDF80D746B3B9C314372C738054FC - - 95D47092AC4D20BAC80E167B185331D42B388FB9 - - 66A52D778FFF3829DC925A33C5CA6DD9A3EBA965 - - DA146E89F004E6185E87867C58B4AC836CBBD130 - - 1D1BC1BDEEB7F3A86BB7ECCF6632585CDC7606E4 - - CCAB0C6E6E190E3091E4290AFF7BA25E9E820989 - - 2CA91CCBF55A49FCB303335DC553B426E3AC635C - - 1883F35475E9A4A12ED6396BC795E5D801DB74B3 - - 71743A7A9E69529643FB49E2201DD99ECA4F72B2 - - 213D30B9768BAE6EB7C1150155B4421347349E77 - - B1F380BB197127A54D0DB470E57DF96B15066C78 -symbols: + HashAlgorithm: 1 + HashValues: + - 4A061540B751965F + - 23ADA4E788EB7A90 + - 32673B3BABE3CA53 + - 56B1521BDAE4BEA7 + - 0661C95750D0206E + - 896FB09488EE8E1B + - B5DECADF1A832BA4 + - 6632585CDC7606E4 + - B97B86241E5F45B0 + - BCD2406E22465E11 + - A528BEF0A7F589C7 + - 6079F1186C40C216 + - 5091EFEBD5B5446B + - 5AAD8721C21DF3E6 +symbols: - Name: .text Value: 0 SectionNumber: 1 SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 25 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -281,7 +282,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 0 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -293,7 +294,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 0 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -305,7 +306,7 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: + SectionDefinition: Length: 48 NumberOfRelocations: 0 NumberOfLinenumbers: 0 @@ -317,11 +318,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 576 + SectionDefinition: + Length: 584 NumberOfRelocations: 7 NumberOfLinenumbers: 0 - CheckSum: 1275848292 + CheckSum: 917356735 Number: 5 - Name: '.debug$T' Value: 0 @@ -329,11 +330,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 312 + SectionDefinition: + Length: 320 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 3001708198 + CheckSum: 2684556216 Number: 6 - Name: '.debug$H' Value: 0 @@ -341,11 +342,11 @@ SimpleType: IMAGE_SYM_TYPE_NULL ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC - SectionDefinition: - Length: 288 + SectionDefinition: + Length: 120 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 3809286526 + CheckSum: 358820662 Number: 7 - Name: '@feat.00' Value: 1 Index: lld/trunk/test/COFF/pdb-global-hashes.test =================================================================== --- lld/trunk/test/COFF/pdb-global-hashes.test +++ lld/trunk/test/COFF/pdb-global-hashes.test @@ -85,7 +85,7 @@ CHECK-NEXT: name = main, type = 0x1002, parent scope = CHECK-NEXT: 0x1001 | LF_STRING_ID [size = {{.*}}] ID: , String: {{.*}}obj.h CHECK-NEXT: 0x1002 | LF_UDT_SRC_LINE [size = 16] -CHECK-NEXT: udt = 0x1008, file = 4097, line = 3 +CHECK-NEXT: udt = 0x1008, file = 4097, line = 2 CHECK-NEXT: 0x1003 | LF_MFUNC_ID [size = 16] CHECK-NEXT: name = Foo, type = 0x1006, class type = 0x1003 CHECK-NEXT: 0x1004 | LF_STRING_ID [size = 12] ID: , String: NS Index: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h =================================================================== --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h @@ -58,7 +58,10 @@ } }; -enum class GlobalTypeHashAlg : uint16_t { SHA1 = 0 }; +enum class GlobalTypeHashAlg : uint16_t { + SHA1 = 0, // standard 20-byte SHA1 hash + SHA1_8 // last 8-bytes of standard SHA1 hash +}; /// A globally hashed type represents a hash value that is sufficient to /// uniquely identify a record across multiple type streams or type sequences. @@ -77,10 +80,10 @@ GloballyHashedType(StringRef H) : GloballyHashedType(ArrayRef(H.bytes_begin(), H.bytes_end())) {} GloballyHashedType(ArrayRef H) { - assert(H.size() == 20); - ::memcpy(Hash.data(), H.data(), 20); + assert(H.size() == 8); + ::memcpy(Hash.data(), H.data(), 8); } - std::array Hash; + std::array Hash; /// Given a sequence of bytes representing a record, compute a global hash for /// this record. Due to the nature of global hashes incorporating the hashes Index: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp =================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -589,7 +589,7 @@ OS.AddComment("Section Version"); OS.EmitIntValue(0, 2); OS.AddComment("Hash Algorithm"); - OS.EmitIntValue(uint16_t(GlobalTypeHashAlg::SHA1), 2); + OS.EmitIntValue(uint16_t(GlobalTypeHashAlg::SHA1_8), 2); TypeIndex TI(TypeIndex::FirstNonSimpleIndex); for (const auto &GHR : TypeTable.hashes()) { @@ -602,7 +602,7 @@ OS.AddComment(Comment); ++TI; } - assert(GHR.Hash.size() % 20 == 0); + assert(GHR.Hash.size() == 8); StringRef S(reinterpret_cast(GHR.Hash.data()), GHR.Hash.size()); OS.EmitBinaryData(S); Index: llvm/trunk/lib/DebugInfo/CodeView/TypeHashing.cpp =================================================================== --- llvm/trunk/lib/DebugInfo/CodeView/TypeHashing.cpp +++ llvm/trunk/lib/DebugInfo/CodeView/TypeHashing.cpp @@ -18,10 +18,9 @@ LocallyHashedType DenseMapInfo::Empty{0, {}}; LocallyHashedType DenseMapInfo::Tombstone{hash_code(-1), {}}; -static std::array EmptyHash; -static std::array TombstoneHash = { - {0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; +static std::array EmptyHash = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; +static std::array TombstoneHash = { + {0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; GloballyHashedType DenseMapInfo::Empty{EmptyHash}; GloballyHashedType DenseMapInfo::Tombstone{TombstoneHash}; @@ -71,5 +70,5 @@ auto TrailingBytes = RecordData.drop_front(Off); S.update(TrailingBytes); - return {S.final()}; + return {S.final().take_back(8)}; } Index: llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp =================================================================== --- llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp +++ llvm/trunk/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp @@ -13,6 +13,8 @@ //===----------------------------------------------------------------------===// #include "llvm/ObjectYAML/CodeViewYAMLTypeHashing.h" + +#include "llvm/BinaryFormat/COFF.h" #include "llvm/Support/BinaryByteStream.h" #include "llvm/Support/BinaryStreamReader.h" #include "llvm/Support/BinaryStreamWriter.h" @@ -46,16 +48,20 @@ DebugHSection llvm::CodeViewYAML::fromDebugH(ArrayRef DebugH) { assert(DebugH.size() >= 8); - assert((DebugH.size() - 8) % 20 == 0); + assert((DebugH.size() - 8) % 8 == 0); BinaryStreamReader Reader(DebugH, llvm::support::little); DebugHSection DHS; cantFail(Reader.readInteger(DHS.Magic)); cantFail(Reader.readInteger(DHS.Version)); cantFail(Reader.readInteger(DHS.HashAlgorithm)); + assert(DHS.Magic == COFF::DEBUG_SECTION_MAGIC && "Invalid .debug$H section!"); + assert(DHS.Version == 1 && "Invalid .debug$H version!"); + assert(DHS.HashAlgorithm == 1 && "Invalid .debug$H algorithm!"); + while (Reader.bytesRemaining() != 0) { ArrayRef S; - cantFail(Reader.readBytes(S, 20)); + cantFail(Reader.readBytes(S, 8)); DHS.Hashes.emplace_back(S); } assert(Reader.bytesRemaining() == 0); @@ -64,19 +70,23 @@ ArrayRef llvm::CodeViewYAML::toDebugH(const DebugHSection &DebugH, BumpPtrAllocator &Alloc) { - uint32_t Size = 8 + 20 * DebugH.Hashes.size(); + uint32_t Size = 8 + 8 * DebugH.Hashes.size(); uint8_t *Data = Alloc.Allocate(Size); MutableArrayRef Buffer(Data, Size); BinaryStreamWriter Writer(Buffer, llvm::support::little); + assert(DebugH.Magic == COFF::DEBUG_SECTION_MAGIC && "Invalid .debug$H section!"); + assert(DebugH.Version == 1 && "Invalid .debug$H version!"); + assert(DebugH.HashAlgorithm == 1 && "Invalid .debug$H algorithm!"); + cantFail(Writer.writeInteger(DebugH.Magic)); cantFail(Writer.writeInteger(DebugH.Version)); cantFail(Writer.writeInteger(DebugH.HashAlgorithm)); - SmallString<20> Hash; + SmallString<8> Hash; for (const auto &H : DebugH.Hashes) { Hash.clear(); raw_svector_ostream OS(Hash); H.Hash.writeAsBinary(OS); - assert((Hash.size() == 20) && "Invalid hash size!"); + assert((Hash.size() == 8) && "Invalid hash size!"); cantFail(Writer.writeFixedString(Hash)); } assert(Writer.bytesRemaining() == 0); Index: llvm/trunk/test/DebugInfo/COFF/global-type-hashes.ll =================================================================== --- llvm/trunk/test/DebugInfo/COFF/global-type-hashes.ll +++ llvm/trunk/test/DebugInfo/COFF/global-type-hashes.ll @@ -273,39 +273,34 @@ ; YAML: Alignment: 4 ; YAML: GlobalHashes: ; YAML: Version: 0 -; YAML: HashAlgorithm: 0 +; YAML: HashAlgorithm: 1 ; YAML: HashValues: -; YAML: - 624A7FEE7323656B7F1C5A63800309EE1ED8BB5B -; YAML: - 0EB2C87AD629AA9E5C98B7A3ED69DB1355707DF1 -; YAML: - 624E463ACE08649D0FC35F163E20CC43089ADCA6 -; YAML: - 4B712C03EDA4CB88537EBAE4005A09006A9FB389 -; YAML: - 59EC21C3D8D594FF77854ABAC324F82D24D22283 -; YAML: - DA76AFB7C767EC00BAA171FEFAA2801D95716C22 -; YAML: - 4927143F1D91A64983DDA6B6DDE23757322DB7C3 -; YAML: - DFDF871AD3841199ACD961EA57243C7A1305B4DD -; YAML: - 20015FA1AD3D0FF3546B4428D341E2F9BE57A1C7 -; YAML: - 8DC9D77BACDD53AAE3A5AC8F41C43D3C3122DCBC -; YAML: - 77A85205D34B9C26802849355086C2937E3F45D8 -; YAML: - 4AEF9C1D1509C0FFA2A02F86B3C28FB0F254096C -; YAML: - 83B03F51A4BABAE1E8B560B40634944401BCC520 -; YAML: - A82772A0D760F3EB5FC7A3022A6D376F5D7A92E2 -; YAML: - 235B46C1A3E3FB71D89ED6085E8B8D38632AACD6 -; YAML: - D52F03DB055DE93F19066E93FB3BA86C5A652429 +; YAML: - E09E6E9DA0F4EE31 +; YAML: - AC3421E42389A5FD +; YAML: - 09DDDA6CB66C9F23 +; YAML: - 01B4ACFA70BEACA1 +; YAML: - 8A222FBBEBBE140E +; YAML: - 4497C6AE188A6220 +; YAML: - 14A9932F03846156 +; YAML: - CBC539F8C18B2D2D +; YAML: - 3E52C5C25299E473 +; YAML: - 8FEE74F5141FCC22 +; YAML: - DF48EB0A8ED58F85 +; YAML: - 8EE98BB0F291CBF8 +; YAML: - D18EEE3C1C0C4C09 +; YAML: - 67C712E2108F482A +; YAML: - 23945F2B63311976 +; YAML: - 7F1CACD4255A7ADF +; ... ; ASM: .section .debug$H,"dr" ; ASM-NEXT: .p2align 2 ; ASM-NEXT: .long 20171205 # Magic ; ASM-NEXT: .short 0 # Section Version -; ASM-NEXT: .short 0 # Hash Algorithm -; ASM-NEXT: .byte 0x62, 0x4a, 0x7f, 0xee # 0x1000 [624A7FEE7323656B7F1C5A63800309EE1ED8BB5B] -; ASM-NEXT: .byte 0x73, 0x23, 0x65, 0x6b -; ASM-NEXT: .byte 0x7f, 0x1c, 0x5a, 0x63 -; ASM-NEXT: .byte 0x80, 0x03, 0x09, 0xee -; ASM-NEXT: .byte 0x1e, 0xd8, 0xbb, 0x5b -; ASM-NEXT: .byte 0x0e, 0xb2, 0xc8, 0x7a # 0x1001 [0EB2C87AD629AA9E5C98B7A3ED69DB1355707DF1] -; ASM-NEXT: .byte 0xd6, 0x29, 0xaa, 0x9e -; ASM-NEXT: .byte 0x5c, 0x98, 0xb7, 0xa3 -; ASM-NEXT: .byte 0xed, 0x69, 0xdb, 0x13 -; ASM-NEXT: .byte 0x55, 0x70, 0x7d, 0xf1 -; ASM-NEXT: .byte 0x62, 0x4e, 0x46, 0x3a # 0x1002 [624E463ACE08649D0FC35F163E20CC43089ADCA6] +; ASM-NEXT: .short 1 # Hash Algorithm +; ASM-NEXT: .byte 0xe0, 0x9e, 0x6e, 0x9d # 0x1000 [E09E6E9DA0F4EE31] +; ASM-NEXT: .byte 0xa0, 0xf4, 0xee, 0x31 +; ASM-NEXT: .byte 0xac, 0x34, 0x21, 0xe4 # 0x1001 [AC3421E42389A5FD] +; ASM-NEXT: .byte 0x23, 0x89, 0xa5, 0xfd +; ASM-NEXT: .byte 0x09, 0xdd, 0xda, 0x6c # 0x1002 [09DDDA6CB66C9F23] Index: llvm/trunk/test/DebugInfo/PDB/obj-globalhash.test =================================================================== --- llvm/trunk/test/DebugInfo/PDB/obj-globalhash.test +++ llvm/trunk/test/DebugInfo/PDB/obj-globalhash.test @@ -14,41 +14,41 @@ ; char**. Both the local and global hashes should be the same, since the only ; back-references are for simple types which have fixed indices. CHECK-ONE: obj-hashes-1 -CHECK-ONE: TI: 0x1001, LocalHash: {{.*}}, GlobalHash: 414E8FCAB16EC28AB86498D1A7F8CF106F39A384 +CHECK-ONE: TI: 0x1001, LocalHash: {{.*}}, GlobalHash: 70FA296AAA577E53 CHECK-ONE: obj-hashes-2 -CHECK-ONE: TI: 0x1000, LocalHash: {{.*}}, GlobalHash: 414E8FCAB16EC28AB86498D1A7F8CF106F39A384 +CHECK-ONE: TI: 0x1000, LocalHash: {{.*}}, GlobalHash: 70FA296AAA577E53 ; int**. Same as char**, both the local and global hashes should be the same. CHECK-TWO: obj-hashes-1 -CHECK-TWO: TI: 0x1000, LocalHash: {{.*}}, GlobalHash: 91D2E2AD5D0F20EC1A24BE2E95D0616C5962F4B1 +CHECK-TWO: TI: 0x1000, LocalHash: {{.*}}, GlobalHash: AC2B89A424EC4805 CHECK-TWO: obj-hashes-2 -CHECK-TWO: TI: 0x1002, LocalHash: {{.*}}, GlobalHash: 91D2E2AD5D0F20EC1A24BE2E95D0616C5962F4B1 +CHECK-TWO: TI: 0x1002, LocalHash: {{.*}}, GlobalHash: AC2B89A424EC4805 ; int***. Different local hashes, since the referent type (int**) is not at the ; same TypeIndex in both streams. Same global hash, since they represent the ; same record. CHECK-THREE: obj-hashes-1 -CHECK-THREE: TI: 0x1002, LocalHash: {{.*}}, GlobalHash: 68A6DDB5C538D379E72E6425591A2B16352DF93D +CHECK-THREE: TI: 0x1002, LocalHash: {{.*}}, GlobalHash: 9D6275A3E1B37A7D CHECK-THREE: obj-hashes-2 -CHECK-THREE: TI: 0x1001, LocalHash: {{.*}}, GlobalHash: 68A6DDB5C538D379E72E6425591A2B16352DF93D +CHECK-THREE: TI: 0x1001, LocalHash: {{.*}}, GlobalHash: 9D6275A3E1B37A7D ; arg list (char**, int***). Different local hashes, since the parameter types ; both occur at different TypeIndices in their respective input streams. Same ; global hash, since the global hash of all referenced types is the same in ; both streams. CHECK-FOUR: obj-hashes-1 -CHECK-FOUR: TI: 0x1003, LocalHash: {{.*}}, GlobalHash: FD539365C0A8DEC0A1567C3E2F4C82E7AADB0E51 +CHECK-FOUR: TI: 0x1003, LocalHash: {{.*}}, GlobalHash: C82DFD641EB22940 CHECK-FOUR: obj-hashes-2 -CHECK-FOUR: TI: 0x1004, LocalHash: {{.*}}, GlobalHash: FD539365C0A8DEC0A1567C3E2F4C82E7AADB0E51 +CHECK-FOUR: TI: 0x1004, LocalHash: {{.*}}, GlobalHash: C82DFD641EB22940 ; double**. This is only in stream 2, as a means to throw off the indexing. CHECK-FIVE: obj-hashes-1 CHECK-FIVE: obj-hashes-2 -CHECK-FIVE: TI: 0x1003, LocalHash: {{.*}}, GlobalHash: 5BB6926CA7924D06908872FA20691EA9B88584CC +CHECK-FIVE: TI: 0x1003, LocalHash: {{.*}}, GlobalHash: 102BD08F68315506 ; int** (char**, int***). For the same logic as described in previous records, ; these two records have the same global hash but different local hashes. CHECK-SIX: obj-hashes-1 -CHECK-SIX: TI: 0x1004, LocalHash: {{.*}}, GlobalHash: 7A8576BA937B2E87BBF94A9CBFA8F993EE746065 +CHECK-SIX: TI: 0x1004, LocalHash: {{.*}}, GlobalHash: 526C704BC7D94D40 CHECK-SIX: obj-hashes-2 -CHECK-SIX: TI: 0x1005, LocalHash: {{.*}}, GlobalHash: 7A8576BA937B2E87BBF94A9CBFA8F993EE746065 +CHECK-SIX: TI: 0x1005, LocalHash: {{.*}}, GlobalHash: 526C704BC7D94D40 Index: llvm/trunk/test/ObjectYAML/CodeView/sections.yaml =================================================================== --- llvm/trunk/test/ObjectYAML/CodeView/sections.yaml +++ llvm/trunk/test/ObjectYAML/CodeView/sections.yaml @@ -23,11 +23,11 @@ Version: 0 HashAlgorithm: 0 HashValues: - - 1522A98D88FAF71B618D97BCAC2B89A424EC4805 - - 8B2BA87CC27BF9D290A31A6070FA296AAA577E53 - - EC11CE9F78D6BF61F8D913A9E2C98293782A7EB4 - - 1088AD64CEBC88D9E015058A159516AF20B79286 - - 457ABCB8AB70407594B5D72BF471B6BDECC99BC9 + - AC2B89A424EC4805 + - 70FA296AAA577E53 + - E2C98293782A7EB4 + - 159516AF20B79286 + - F471B6BDECC99BC9 symbols: - Name: '.debug$T' Value: 0 @@ -76,11 +76,11 @@ # CHECK: Version: 0 # CHECK: HashAlgorithm: 0 # CHECK: HashValues: -# CHECK: - 1522A98D88FAF71B618D97BCAC2B89A424EC4805 -# CHECK: - 8B2BA87CC27BF9D290A31A6070FA296AAA577E53 -# CHECK: - EC11CE9F78D6BF61F8D913A9E2C98293782A7EB4 -# CHECK: - 1088AD64CEBC88D9E015058A159516AF20B79286 -# CHECK: - 457ABCB8AB70407594B5D72BF471B6BDECC99BC9 +# CHECK: - AC2B89A424EC4805 +# CHECK: - 70FA296AAA577E53 +# CHECK: - E2C98293782A7EB4 +# CHECK: - 159516AF20B79286 +# CHECK: - F471B6BDECC99BC9 # CHECK: symbols: # CHECK: - Name: '.debug$T' # CHECK: Value: 0 @@ -109,4 +109,4 @@ # CHECK: ... # HEADERS: 0 .debug$T 00000040 0000000000000000 DATA -# HEADERS: 1 .debug$H 0000006c 0000000000000000 DATA +# HEADERS: 1 .debug$H 00000030 0000000000000000 DATA