]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.link] Merge branch 'master' into dev.link
authorJeremy Faller <jeremy@golang.org>
Wed, 30 Sep 2020 21:57:14 +0000 (17:57 -0400)
committerJeremy Faller <jeremy@golang.org>
Wed, 30 Sep 2020 22:00:58 +0000 (18:00 -0400)
2 conflicts, that make sense.
src/cmd/internal/obj/objfile.go
src/cmd/link/internal/loader/loader.go

Change-Id: Ib224e2d248cb568fa1e888af79dd908b2f5e05ff

1  2 
src/cmd/internal/obj/objfile.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/loader/loader.go
src/runtime/runtime2.go

index a2bbdff24e00a52c184ed381d4eaeda748abf54b,186016c9706c67d89e4d4e8e4c72f02e788398d4..fa60c9ad6d845d1b7909a17feedb11d2a3d224c5
@@@ -376,19 -372,13 +376,26 @@@ func contentHash64(s *LSym) goobj.Hash6
  // hashed symbols.
  func (w *writer) contentHash(s *LSym) goobj.HashType {
        h := sha1.New()
 +      var tmp [14]byte
 +
 +      // Include the size of the symbol in the hash.
 +      // This preserves the length of symbols, preventing the following two symbols
 +      // from hashing the same:
 +      //
 +      //    [2]int{1,2} ≠ [10]int{1,2,0,0,0...}
 +      //
 +      // In this case, if the smaller symbol is alive, the larger is not kept unless
 +      // needed.
 +      binary.LittleEndian.PutUint64(tmp[:8], uint64(s.Size))
 +      h.Write(tmp[:8])
 +
+       // Don't dedup type symbols with others, as they are in a different
+       // section.
+       if strings.HasPrefix(s.Name, "type.") {
+               h.Write([]byte{'T'})
+       } else {
+               h.Write([]byte{0})
+       }
        // The compiler trims trailing zeros _sometimes_. We just do
        // it always.
        h.Write(bytes.TrimRight(s.P, "\x00"))
Simple merge
Simple merge
Simple merge