Index: lld/COFF/PDB.cpp =================================================================== --- lld/COFF/PDB.cpp +++ lld/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/test/COFF/Inputs/pdb-hashes-1.yaml =================================================================== --- lld/test/COFF/Inputs/pdb-hashes-1.yaml +++ lld/test/COFF/Inputs/pdb-hashes-1.yaml @@ -33,7 +33,7 @@ - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 04000000F10000002F0000002D003C1101000000070006000000000000007017000000000000636C616E672076657273696F6E20362E302E30200000F50000008400000000000000000000004100000000000000080000000000000052000000070000000400000001000000400000000000000008000000000000007F0000000600040000000000030000003E000000000000000800000000000000BD0000000400040000000000040000003D000000000000000800000000000000FA0000000300080000000000F1000000960000002A00471100000000000000000000000041000000000000000000000003100000000000000000006D61696E000D003E1174000000010061726763001200451116000000080000001700000000002A000D003E11001000000100617267760012004511160000000C0000001700000000002A000A003E1109100000000066001200451116000000F4FFFFFF1700000000002A0002004F110000F200000030000000000000000000000041000000000000000300000024000000000000000300000017000000040000003000000005000000F1000000100000000E000811091000004E533A3A466F6F00F40000003000000001000000100165C9E387F88362A8EB2B49539DD5A65500002B00000010019303CF100D518DAF59C31DA01FEF4AFC0000F30000004801000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A312E63707000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A2E6800245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D2024657369202454302038202D205E203D2000 + SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F50000008400000000000000000000004100000000000000080000000000000052000000070000000400000001000000400000000000000008000000000000007F0000000600040000000000030000003E000000000000000800000000000000BD0000000400040000000000040000003D000000000000000800000000000000FA0000000300080000000000F1000000960000002A00471100000000000000000000000041000000000000000000000003100000000000000000006D61696E000D003E1174000000010061726763001200451116000000080000001700000000002A000D003E11001000000100617267760012004511160000000C0000001700000000002A000A003E1109100000000066001200451116000000F4FFFFFF1700000000002A0002004F110000F200000030000000000000000000000041000000000000000300000024000000000000000300000017000000040000003000000005000000F1000000100000000E000811091000004E533A3A466F6F00F40000003000000001000000100165C9E387F88362A8EB2B49539DD5A65500002B00000010019303CF100D518DAF59C31DA01FEF4AFC0000F30000004801000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A312E63707000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A2E6800245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D2024657369202454302038202D205E203D2000 Subsections: - !Symbols Records: @@ -41,15 +41,15 @@ Compile3Sym: Flags: [ ] Machine: Pentium3 - FrontendMajor: 6 + FrontendMajor: 7 FrontendMinor: 0 FrontendBuild: 0 FrontendQFE: 0 - BackendMajor: 6000 + BackendMajor: 7000 BackendMinor: 0 BackendBuild: 0 BackendQFE: 0 - Version: 'clang version 6.0.0 ' + Version: 'clang version 7.0.0 ' - !FrameData Frames: - CodeSize: 65 @@ -99,16 +99,46 @@ Type: 116 Flags: [ IsParameter ] VarName: argc + - Kind: S_DEFRANGE_REGISTER_REL + DefRangeRegisterRelSym: + Register: 22 + Flags: 0 + BasePointerOffset: 8 + Range: + OffsetStart: 23 + ISectStart: 0 + Range: 42 + Gaps: - Kind: S_LOCAL LocalSym: Type: 4096 Flags: [ IsParameter ] VarName: argv + - Kind: S_DEFRANGE_REGISTER_REL + DefRangeRegisterRelSym: + Register: 22 + Flags: 0 + BasePointerOffset: 12 + Range: + OffsetStart: 23 + ISectStart: 0 + Range: 42 + Gaps: - Kind: S_LOCAL LocalSym: Type: 4105 Flags: [ ] VarName: f + - Kind: S_DEFRANGE_REGISTER_REL + DefRangeRegisterRelSym: + Register: 22 + Flags: 0 + BasePointerOffset: -12 + Range: + OffsetStart: 23 + ISectStart: 0 + Range: 42 + Gaps: - Kind: S_PROC_ID_END ScopeEndSym: - !Lines @@ -280,24 +310,24 @@ - Name: '.debug$H' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: C5C93301000000009E56666824DC4B12E25261D4E09E6E9DA0F4EE31FDEC3D2D96287486127C66070B248ED52E421F55074AE5CC2D68AF9F0A3BEF23993968F7FD82CA84BF0439C1A64C9070C6A6ADB0A34D21DAD0FFC3E99E616EF06A14EA74A2420F9062A1FB04917E5975E3A50EABE5E8FE3945468547C19DC681D0BFB3B797DD91CA4D7F1953C314442D5549419E78044E38A0BF16BFFAA5EE9C0103E7DBFE9941E63379C0B0C0A9021B711ACC4F67008974EBF441031BDD653F6935DFF3112C6A5346EF2AC94B9B7EB56EF55CFA0AF6C1846743F43D846BB19517E12E8873BBA90CC41DD1BEAC89CBA8897AC1BA46762E2557A82D894CEAE81AEF8680D723D403D9A4481F0E28683A98 + SectionData: C5C9330100000000E09E6E9DA0F4EE31AC3421E42389A5FD09DDDA6CB66C9F2301B4ACFA70BEACA162A1FB04917E597564A062B1FCB9248A5549419E78044E38A21119B34CB7250BC3EB8F545517B7B6CD4A36E4657A592117E12E8873BBA90CCAAE80925A1C70DA770F9F3EC6DDF03D GlobalHashes: Version: 0 HashAlgorithm: 0 HashValues: - - 9E56666824DC4B12E25261D4E09E6E9DA0F4EE31 - - FDEC3D2D96287486127C66070B248ED52E421F55 - - 074AE5CC2D68AF9F0A3BEF23993968F7FD82CA84 - - BF0439C1A64C9070C6A6ADB0A34D21DAD0FFC3E9 - - 9E616EF06A14EA74A2420F9062A1FB04917E5975 - - E3A50EABE5E8FE3945468547C19DC681D0BFB3B7 - - 97DD91CA4D7F1953C314442D5549419E78044E38 - - A0BF16BFFAA5EE9C0103E7DBFE9941E63379C0B0 - - C0A9021B711ACC4F67008974EBF441031BDD653F - - 6935DFF3112C6A5346EF2AC94B9B7EB56EF55CFA - - 0AF6C1846743F43D846BB19517E12E8873BBA90C - - C41DD1BEAC89CBA8897AC1BA46762E2557A82D89 - - 4CEAE81AEF8680D723D403D9A4481F0E28683A98 + - E09E6E9DA0F4EE31 + - AC3421E42389A5FD + - 09DDDA6CB66C9F23 + - 01B4ACFA70BEACA1 + - 62A1FB04917E5975 + - 64A062B1FCB9248A + - 5549419E78044E38 + - A21119B34CB7250B + - C3EB8F545517B7B6 + - CD4A36E4657A5921 + - 17E12E8873BBA90C + - CAAE80925A1C70DA + - 770F9F3EC6DDF03D - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 @@ -344,11 +374,31 @@ Type: 4101 Flags: [ IsParameter ] VarName: this + - Kind: S_DEFRANGE_REGISTER_REL + DefRangeRegisterRelSym: + Register: 22 + Flags: 0 + BasePointerOffset: -4 + Range: + OffsetStart: 15 + ISectStart: 0 + Range: 17 + Gaps: - Kind: S_LOCAL LocalSym: Type: 116 Flags: [ IsParameter ] VarName: x + - Kind: S_DEFRANGE_REGISTER_REL + DefRangeRegisterRelSym: + Register: 22 + Flags: 0 + BasePointerOffset: 8 + Range: + OffsetStart: 15 + ISectStart: 0 + Range: 17 + Gaps: - Kind: S_PROC_ID_END ScopeEndSym: - !Lines @@ -470,7 +520,7 @@ Length: 832 NumberOfRelocations: 11 NumberOfLinenumbers: 0 - CheckSum: 4106171226 + CheckSum: 3390759736 Number: 6 - Name: '.debug$S' Value: 0 @@ -504,10 +554,10 @@ ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC SectionDefinition: - Length: 268 + Length: 112 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 3965031229 + CheckSum: 3890004957 Number: 8 - Name: '@feat.00' Value: 1 Index: lld/test/COFF/Inputs/pdb-hashes-2.yaml =================================================================== --- lld/test/COFF/Inputs/pdb-hashes-2.yaml +++ lld/test/COFF/Inputs/pdb-hashes-2.yaml @@ -22,7 +22,7 @@ - Name: '.debug$S' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: 04000000F10000002F0000002D003C1101000000070006000000000000007017000000000000636C616E672076657273696F6E20362E302E30200000F5000000640000000000000000000000190000000000000004000000000000002B000000040000000400000001000000180000000000000004000000000000005800000003000400000000000300000016000000000000000400000000000000960000000100040000000000F1000000540000002E0047110000000000000000000000001900000000000000000000000D100000000000000000004E533A3A66756E63000A003E110310000001006600120045111600000008000000070000000000120002004F11F20000002800000000000000000000001900000000000000020000001C00000000000000030000000700000004000000F1000000100000000E0008110A1000004E533A3A466F6F00F40000001800000001000000100159DFAC75D18675AED1AD169FE316317E0000F3000000D400000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A322E63707000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200000 + SectionData: 04000000F10000002F0000002D003C110100000007000700000000000000581B000000000000636C616E672076657273696F6E20372E302E30200000F5000000640000000000000000000000190000000000000004000000000000002B000000040000000400000001000000180000000000000004000000000000005800000003000400000000000300000016000000000000000400000000000000960000000100040000000000F1000000540000002E0047110000000000000000000000001900000000000000000000000D100000000000000000004E533A3A66756E63000A003E110310000001006600120045111600000008000000070000000000120002004F11F20000002800000000000000000000001900000000000000020000001C00000000000000030000000700000004000000F1000000100000000E0008110A1000004E533A3A466F6F00F40000001800000001000000100159DFAC75D18675AED1AD169FE316317E0000F3000000D400000000443A5C7372635C6C6C766D6275696C645C636C616E675C44656275675C7838365C6F626A322E63707000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2000245430202E7261536561726368203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200024543020246562702034202B203D202465697020245430205E203D2024657370202454302034202B203D2024656270202454302034202D205E203D200000 Subsections: - !Symbols Records: @@ -30,15 +30,15 @@ Compile3Sym: Flags: [ ] Machine: Pentium3 - FrontendMajor: 6 + FrontendMajor: 7 FrontendMinor: 0 FrontendBuild: 0 FrontendQFE: 0 - BackendMajor: 6000 + BackendMajor: 7000 BackendMinor: 0 BackendBuild: 0 BackendQFE: 0 - Version: 'clang version 6.0.0 ' + Version: 'clang version 7.0.0 ' - !FrameData Frames: - CodeSize: 25 @@ -80,6 +80,16 @@ Type: 4099 Flags: [ IsParameter ] VarName: f + - Kind: S_DEFRANGE_REGISTER_REL + DefRangeRegisterRelSym: + Register: 22 + Flags: 0 + BasePointerOffset: 8 + Range: + OffsetStart: 7 + ISectStart: 0 + Range: 18 + Gaps: - Kind: S_PROC_ID_END ScopeEndSym: - !Lines @@ -234,25 +244,25 @@ - Name: '.debug$H' Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ] Alignment: 4 - SectionData: C5C9330100000000EC145CD76AEFE74E78880D531132B3BB8FFACEF79E616EF06A14EA74A2420F9062A1FB04917E59759949E334BA18509ED692F3C65CE242D8450EBC78B81B63AF8316DC324562EB9F0D4A0D708E8A25C263DB05943C19B84A36719E1E414DDA3EDBDF005322238D70F9058EEDC5C50EF11BC849618B51FD89E3A50EABE5E8FE3945468547C19DC681D0BFB3B797DD91CA4D7F1953C314442D5549419E78044E38A0BF16BFFAA5EE9C0103E7DBFE9941E63379C0B0C0A9021B711ACC4F67008974EBF441031BDD653F6935DFF3112C6A5346EF2AC94B9B7EB56EF55CFA0AF6C1846743F43D846BB19517E12E8873BBA90CC41DD1BEAC89CBA8897AC1BA46762E2557A82D89DCBC783AF285D9DBB672F67A81E36906B2038B57 + SectionData: C5C93301000000001132B3BB8FFACEF762A1FB04917E59753DA2762F3225F51A8FA9212E3E55CADC906D3449ACE2D416DAD6C5B5AFFA8CB164A062B1FCB9248A5549419E78044E38A21119B34CB7250BC3EB8F545517B7B6CD4A36E4657A592117E12E8873BBA90CCAAE80925A1C70DA860C83C14160CAC4 GlobalHashes: Version: 0 HashAlgorithm: 0 HashValues: - - EC145CD76AEFE74E78880D531132B3BB8FFACEF7 - - 9E616EF06A14EA74A2420F9062A1FB04917E5975 - - 9949E334BA18509ED692F3C65CE242D8450EBC78 - - B81B63AF8316DC324562EB9F0D4A0D708E8A25C2 - - 63DB05943C19B84A36719E1E414DDA3EDBDF0053 - - 22238D70F9058EEDC5C50EF11BC849618B51FD89 - - E3A50EABE5E8FE3945468547C19DC681D0BFB3B7 - - 97DD91CA4D7F1953C314442D5549419E78044E38 - - A0BF16BFFAA5EE9C0103E7DBFE9941E63379C0B0 - - C0A9021B711ACC4F67008974EBF441031BDD653F - - 6935DFF3112C6A5346EF2AC94B9B7EB56EF55CFA - - 0AF6C1846743F43D846BB19517E12E8873BBA90C - - C41DD1BEAC89CBA8897AC1BA46762E2557A82D89 - - DCBC783AF285D9DBB672F67A81E36906B2038B57 + - 1132B3BB8FFACEF7 + - 62A1FB04917E5975 + - 3DA2762F3225F51A + - 8FA9212E3E55CADC + - 906D3449ACE2D416 + - DAD6C5B5AFFA8CB1 + - 64A062B1FCB9248A + - 5549419E78044E38 + - A21119B34CB7250B + - C3EB8F545517B7B6 + - CD4A36E4657A5921 + - 17E12E8873BBA90C + - CAAE80925A1C70DA + - 860C83C14160CAC4 symbols: - Name: .text Value: 0 @@ -312,7 +322,7 @@ Length: 584 NumberOfRelocations: 7 NumberOfLinenumbers: 0 - CheckSum: 2847177244 + CheckSum: 917356735 Number: 5 - Name: '.debug$T' Value: 0 @@ -333,10 +343,10 @@ ComplexType: IMAGE_SYM_DTYPE_NULL StorageClass: IMAGE_SYM_CLASS_STATIC SectionDefinition: - Length: 288 + Length: 120 NumberOfRelocations: 0 NumberOfLinenumbers: 0 - CheckSum: 2348181452 + CheckSum: 2047444147 Number: 7 - Name: '@feat.00' Value: 1 Index: llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h =================================================================== --- llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h +++ llvm/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/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ llvm/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/lib/DebugInfo/CodeView/TypeHashing.cpp =================================================================== --- llvm/lib/DebugInfo/CodeView/TypeHashing.cpp +++ llvm/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}; @@ -70,5 +69,5 @@ auto TrailingBytes = RecordData.drop_front(Off); S.update(TrailingBytes); - return {S.final()}; + return {S.final().take_back(8)}; } Index: llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp =================================================================== --- llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp +++ llvm/lib/ObjectYAML/CodeViewYAMLTypeHashing.cpp @@ -46,7 +46,7 @@ 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; @@ -55,7 +55,7 @@ cantFail(Reader.readInteger(DHS.HashAlgorithm)); 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 +64,19 @@ 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); 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/test/DebugInfo/COFF/global-type-hashes.ll =================================================================== --- llvm/test/DebugInfo/COFF/global-type-hashes.ll +++ llvm/test/DebugInfo/COFF/global-type-hashes.ll @@ -273,24 +273,24 @@ ; YAML: Alignment: 4 ; YAML: GlobalHashes: ; YAML: Version: 0 -; YAML: HashAlgorithm: 0 +; YAML: HashAlgorithm: 1 ; YAML: HashValues: -; YAML: - 9E56666824DC4B12E25261D4E09E6E9DA0F4EE31 -; YAML: - FDEC3D2D96287486127C66070B248ED52E421F55 -; YAML: - 074AE5CC2D68AF9F0A3BEF23993968F7FD82CA84 -; YAML: - BF0439C1A64C9070C6A6ADB0A34D21DAD0FFC3E9 -; YAML: - CF1B3AD4A96BA628E6556FD28A222FBBEBBE140E -; YAML: - EC50195BFE148C0DC6A87A59D49CA1D9B146DB86 -; YAML: - 123C8BA63AD23386897AB6D814A9932F03846156 -; YAML: - 0F135243878289B83835BC2DB9EE25A1D4D0DA2B -; YAML: - 9069CA78E7450A285173431B3E52C5C25299E473 -; YAML: - ADA6E11350E9F2069D4689E3646C90D67B28DA62 -; YAML: - BD535FA9877A4DD123840AF849F3B0110EEB1D7A -; YAML: - 8044F70193FE40B71867158C5E50F0467485FA99 -; YAML: - 558606D57A76D125B705FC6DD18EEE3C1C0C4C09 -; YAML: - A64A018D9EB1EB8015917925662C8508D81CDA68 -; YAML: - 51E89AD9992AC6F11F9E3F1665F41C53BDA8AFC4 -; YAML: - 4F1C3BCA73099EF3466AAC99CC4951767DF890F5 +; 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 ; ... @@ -298,15 +298,9 @@ ; ASM-NEXT: .p2align 2 ; ASM-NEXT: .long 20171205 # Magic ; ASM-NEXT: .short 0 # Section Version -; ASM-NEXT: .short 0 # Hash Algorithm -; ASM-NEXT: .byte 0x9e, 0x56, 0x66, 0x68 # 0x1000 [9E56666824DC4B12E25261D4E09E6E9DA0F4EE31] -; ASM-NEXT: .byte 0x24, 0xdc, 0x4b, 0x12 -; ASM-NEXT: .byte 0xe2, 0x52, 0x61, 0xd4 -; ASM-NEXT: .byte 0xe0, 0x9e, 0x6e, 0x9d +; 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 0xfd, 0xec, 0x3d, 0x2d # 0x1001 [FDEC3D2D96287486127C66070B248ED52E421F55] -; ASM-NEXT: .byte 0x96, 0x28, 0x74, 0x86 -; ASM-NEXT: .byte 0x12, 0x7c, 0x66, 0x07 -; ASM-NEXT: .byte 0x0b, 0x24, 0x8e, 0xd5 -; ASM-NEXT: .byte 0x2e, 0x42, 0x1f, 0x55 -; ASM-NEXT: .byte 0x07, 0x4a, 0xe5, 0xcc # 0x1002 [074AE5CC2D68AF9F0A3BEF23993968F7FD82CA84] +; 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/test/DebugInfo/PDB/obj-globalhash.test =================================================================== --- llvm/test/DebugInfo/PDB/obj-globalhash.test +++ llvm/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: 8B2BA87CC27BF9D290A31A6070FA296AAA577E53 +CHECK-ONE: TI: 0x1001, LocalHash: {{.*}}, GlobalHash: 70FA296AAA577E53 CHECK-ONE: obj-hashes-2 -CHECK-ONE: TI: 0x1000, LocalHash: {{.*}}, GlobalHash: 8B2BA87CC27BF9D290A31A6070FA296AAA577E53 +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: 1522A98D88FAF71B618D97BCAC2B89A424EC4805 +CHECK-TWO: TI: 0x1000, LocalHash: {{.*}}, GlobalHash: AC2B89A424EC4805 CHECK-TWO: obj-hashes-2 -CHECK-TWO: TI: 0x1002, LocalHash: {{.*}}, GlobalHash: 1522A98D88FAF71B618D97BCAC2B89A424EC4805 +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: EC11CE9F78D6BF61F8D913A9E2C98293782A7EB4 +CHECK-THREE: TI: 0x1002, LocalHash: {{.*}}, GlobalHash: 9D6275A3E1B37A7D CHECK-THREE: obj-hashes-2 -CHECK-THREE: TI: 0x1001, LocalHash: {{.*}}, GlobalHash: EC11CE9F78D6BF61F8D913A9E2C98293782A7EB4 +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: 1088AD64CEBC88D9E015058A159516AF20B79286 +CHECK-FOUR: TI: 0x1003, LocalHash: {{.*}}, GlobalHash: C82DFD641EB22940 CHECK-FOUR: obj-hashes-2 -CHECK-FOUR: TI: 0x1004, LocalHash: {{.*}}, GlobalHash: 1088AD64CEBC88D9E015058A159516AF20B79286 +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: 7803BBDB2947EF46BEA2310D102BD08F68315506 +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: 457ABCB8AB70407594B5D72BF471B6BDECC99BC9 +CHECK-SIX: TI: 0x1004, LocalHash: {{.*}}, GlobalHash: 526C704BC7D94D40 CHECK-SIX: obj-hashes-2 -CHECK-SIX: TI: 0x1005, LocalHash: {{.*}}, GlobalHash: 457ABCB8AB70407594B5D72BF471B6BDECC99BC9 +CHECK-SIX: TI: 0x1005, LocalHash: {{.*}}, GlobalHash: 526C704BC7D94D40 Index: llvm/test/ObjectYAML/CodeView/sections.yaml =================================================================== --- llvm/test/ObjectYAML/CodeView/sections.yaml +++ llvm/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