]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: enforce single level of 'outer' sym
authorThan McIntosh <thanm@google.com>
Thu, 30 Apr 2020 13:04:08 +0000 (09:04 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 1 May 2020 16:49:36 +0000 (16:49 +0000)
commit24814e214776ae5165083a963db5c56abbde4176
treee9a73d2ab0772f62d1698dffac46e54c2008715e
parent1667b35740bd6974082cba6b48b4ea1881e29088
[dev.link] cmd/link: enforce single level of 'outer' sym

Add code to the loader to enforce the invariant that there is only a
single level of 'outer' symbol nesting. That is, if outer(X) = Y, then
outer(Y) is always zero.

Revise foldSubSymbolOffset based on the new invariant, allowing it to
be inlined, and then fix the various "for s.Outer != nil" loops in the
linker to just use an "if" instead of a loop.

Change-Id: Ib895702bc6de52718248f09a5368b84cb2e0a3fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/231137
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/arm64/asm.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/data2.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/loader/loader.go
src/cmd/link/internal/mips/asm.go
src/cmd/link/internal/mips64/asm.go
src/cmd/link/internal/ppc64/asm.go