mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/gc, cmd/internal/ld, cmd/internal/obj: teach compiler about local symbols
This lets us avoid loading string constants via the GOT and (together with http://golang.org/cl/9102) results in the fannkuch benchmark having very similar register usage with -dynlink as without. Change-Id: Ic3892b399074982b76773c3e547cfbba5dabb6f9 Reviewed-on: https://go-review.googlesource.com/9103 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
0e6a6c510f
commit
029c7bbdfe
11 changed files with 55 additions and 37 deletions
|
|
@ -400,7 +400,11 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
|
|||
wrint(b, int64(s.Type))
|
||||
wrstring(b, s.Name)
|
||||
wrint(b, int64(s.Version))
|
||||
wrint(b, int64(s.Dupok))
|
||||
flags := int64(s.Dupok)
|
||||
if s.Local {
|
||||
flags |= 2
|
||||
}
|
||||
wrint(b, flags)
|
||||
wrint(b, s.Size)
|
||||
wrsym(b, s.Gotype)
|
||||
wrdata(b, s.P)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue