[dev.link] cmd/link: fix buglet in setupdynexp

This should restore deterministic order of dynexp, and fix
Solaris build.

Change-Id: Icb796babaa3238bff90fd8255ee9f023f2306c26
Reviewed-on: https://go-review.googlesource.com/c/go/+/225538
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2020-03-25 17:22:57 -04:00
parent ca18c37ee8
commit c02cd04fe1

View file

@ -620,7 +620,7 @@ func setupdynexp(ctxt *Link) {
panic("dynexp entry not reachable") panic("dynexp entry not reachable")
} }
} }
sort.Slice(dynexp, func(i, j int) bool { sort.Slice(d, func(i, j int) bool {
return ctxt.loader.SymName(d[i]) < ctxt.loader.SymName(d[j]) return ctxt.loader.SymName(d[i]) < ctxt.loader.SymName(d[j])
}) })