mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile, runtime: make the go.itab.* symbols module-local
Otherwise, the way the ELF dynamic linker works means that you can end up with the same itab being passed to additab twice, leading to the itab linked list having a cycle in it. Add a test to additab in runtime to catch this when it happens, not some arbitrary and surprsing time later. Fixes #17594 Change-Id: I6c82edcc9ac88ac188d1185370242dc92f46b1ad Reviewed-on: https://go-review.googlesource.com/32131 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
aabdb66d89
commit
8b07ec20f7
4 changed files with 21 additions and 2 deletions
|
|
@ -1,5 +1,10 @@
|
|||
package depBase
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
var V int = 1
|
||||
|
||||
var HasMask []string = []string{"hi"}
|
||||
|
|
@ -13,6 +18,10 @@ type Dep struct {
|
|||
}
|
||||
|
||||
func (d *Dep) Method() int {
|
||||
// This code below causes various go.itab.* symbols to be generated in
|
||||
// the shared library. Similar code in ../exe/exe.go results in
|
||||
// exercising https://github.com/golang/go/issues/17594
|
||||
reflect.TypeOf(os.Stdout).Elem()
|
||||
return 10
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue