]> Cypherpunks repositories - gostls13.git/commit
cmd/link, runtime: remove typelinks
authorIan Lance Taylor <iant@golang.org>
Wed, 26 Nov 2025 06:44:11 +0000 (22:44 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 27 Jan 2026 21:47:14 +0000 (13:47 -0800)
commit481ab86aafe0cac177df793c9946c5ef2126137c
treedbe3504b8dae8baaf51c933b57b62503db98d356
parent251f3aa6ee6fc3925fe8e64cd4b403bfa73b93ab
cmd/link, runtime: remove typelinks

Instead of adding a typelinks section to a Go binary,
mark the start and end of the typelinked type descriptors.
The runtime can then step through the descriptors to find them all,
rather than relying on the extra linker-generated offset list.

The runtime steps through the type descriptors lazily,
as many Go programs don't need the typelinks list at all.

This reduces the size of cmd/go by 15K bytes, which isn't much
but it's not nothing.

A future CL will change the reflect package to use the type pointers
directly rather than converting to offsets and then back to type pointers.

For #6853

Change-Id: Id0af4ce81c5b1cea899fc92b6ff9d2db8ce4c267
Reviewed-on: https://go-review.googlesource.com/c/go/+/724261
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/elf_test.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/ld/typelink.go
src/cmd/link/internal/wasm/asm.go
src/runtime/lockrank.go
src/runtime/mklockrank.go
src/runtime/runtime1.go
src/runtime/symtab.go
src/runtime/type.go