mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/internal/obj: make integer/float constant symbols content-addressable
Fill in the data at compile time, and get rid of the preprocess function in the linker. We need to be careful with symbol alignment: data symbols are generally naturally aligned, except for string symbols which are not aligned. When deduplicating two symbols with same content but different alignments, we need to keep the biggest alignment. Change-Id: I4bd96adfdc5f704b5bf3a0e723457c9bfe16a684 Reviewed-on: https://go-review.googlesource.com/c/go/+/242081 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jeremy Faller <jeremy@golang.org>
This commit is contained in:
parent
17344d55d6
commit
3c54069907
5 changed files with 75 additions and 50 deletions
|
|
@ -704,6 +704,12 @@ type Link struct {
|
|||
// actually diverge.
|
||||
ABIAliases []*LSym
|
||||
|
||||
// Constant symbols (e.g. $i64.*) are data symbols created late
|
||||
// in the concurrent phase. To ensure a deterministic order, we
|
||||
// add them to a separate list, sort at the end, and append it
|
||||
// to Data.
|
||||
constSyms []*LSym
|
||||
|
||||
// pkgIdx maps package path to index. The index is used for
|
||||
// symbol reference in the object file.
|
||||
pkgIdx map[string]int32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue