1
0
mirror of https://github.com/golang/go synced 2024-11-24 10:50:13 -07:00

cmd/link: don't sort pclntab entries

They are already in a good order. The sort here does nothing, as
all the SymValues are 0. Sorting just arbitrarily permutes items
because everything is equal and the sort isn't stable.

Not sure why the ordering of these symbols matter. That ordering was
added in CL 243223.

Change-Id: Iee153394afdb39387701cfe0375bc022cf4bd489
Reviewed-on: https://go-review.googlesource.com/c/go/+/399540
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@google.com>
This commit is contained in:
Keith Randall 2022-04-12 13:34:42 -07:00 committed by Gopher Robot
parent fc1d4c11df
commit 1f97f960e7

View File

@ -2112,12 +2112,7 @@ func (state *dodataState) dodataSect(ctxt *Link, symn sym.SymKind, syms []loader
return si < sj
})
} else {
// PCLNTAB was built internally, and has the proper order based on value.
// Sort the symbols as such.
for k, s := range syms {
sl[k].val = ldr.SymValue(s)
}
sort.Slice(sl, func(i, j int) bool { return sl[i].val < sl[j].val })
// PCLNTAB was built internally, and already has the proper order.
}
// Set alignment, construct result