]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: make it easier to debug an elfrelocsect size mismatch
authorJoel Sing <joel@sing.id.au>
Thu, 23 Jul 2020 17:38:38 +0000 (03:38 +1000)
committerJoel Sing <joel@sing.id.au>
Wed, 16 Sep 2020 16:07:00 +0000 (16:07 +0000)
Change-Id: I54976b004b4db006509f5e0781b1c2e46cfa09ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/244577
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Joel Sing <joel@sing.id.au>

src/cmd/link/internal/ld/elf.go

index 2862f65f9f3a906aff01ab7ca830d3a367e405fc..f5a2f899fc4533c0d58fc1fb6af0248cc140fb83 100644 (file)
@@ -12,6 +12,7 @@ import (
        "crypto/sha1"
        "encoding/binary"
        "encoding/hex"
+       "fmt"
        "path/filepath"
        "sort"
        "strings"
@@ -1400,7 +1401,7 @@ func elfrelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sym)
 
        // sanity check
        if uint64(out.Offset()) != sect.Reloff+sect.Rellen {
-               panic("elfrelocsect: size mismatch")
+               panic(fmt.Sprintf("elfrelocsect: size mismatch %d != %d + %d", out.Offset(), sect.Reloff, sect.Rellen))
        }
 }