]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: remove duplicate symtab entry for global functions
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 2 Nov 2015 20:36:53 +0000 (09:36 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 2 Nov 2015 23:07:12 +0000 (23:07 +0000)
golang.org/cl/16436 added a local symbol for every global function, but also
added a duplicate entry for the global symbol. Surprisingly this hasn't caused
any noticeable problems, but it's still wrong.

Change-Id: Icd3906760f8aaf7bef31ffd4f2d866d73d36dc2c
Reviewed-on: https://go-review.googlesource.com/16581
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/symtab.go

index c53037168ab43d274f89258c4d765995569b98eb..005e876d288fa4553b02c4dbd4c4d42b166857d0 100644 (file)
@@ -175,6 +175,7 @@ func putelfsym(x *LSym, s string, t int, addr int64, size int64, ver int, go_ *L
                putelfsyment(putelfstr("local."+s), addr, size, STB_LOCAL<<4|type_&0xf, elfshnum, other)
                x.LocalElfsym = int32(numelfsym)
                numelfsym++
+               return
        } else if bind != elfbind {
                return
        }