]> Cypherpunks repositories - gostls13.git/commit
cmd/link: put type descriptors in .go.type section
authorIan Lance Taylor <iant@golang.org>
Mon, 24 Nov 2025 04:47:50 +0000 (20:47 -0800)
committerGopher Robot <gobot@golang.org>
Fri, 23 Jan 2026 06:14:33 +0000 (22:14 -0800)
commit13096a62e600ad73ee42063b557d3805078f5982
tree9153af59ee12034eb49ba55708af19482ba77032
parent6edb9f9c51f4f9042563f6fcf68701d1fed33c8f
cmd/link: put type descriptors in .go.type section

This change rewrites and simplifies the relro handling.
We eliminate the separate relro SymKind values and the complex
shifting of symbol kinds. Instead, we put the possible relro data
into their own sections, and make those sections relro when appropriate.

We put type descriptors and their associated data into a
new .go.type section. As part of this we change the runtime.etypes
symbol to be the end of the new section, rather than the end of
rodata as it was before.

We put function descriptors into a new .go.func section.

Ordinary rodata relro stays in the .data.rel.ro section.

We stop making the typelink section relro, as it only contains
offsets and never has dynamic relocations.

We drop the typerel:* and go:funcdescrel symbols.

For #76038

Change-Id: I7aab7cfad3f2623ff06c09a70b756fe1e43f4169
Reviewed-on: https://go-review.googlesource.com/c/go/+/723580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/macho_test.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/ld/xcoff.go
src/cmd/link/internal/sym/symkind.go
src/cmd/link/internal/sym/symkind_string.go
src/cmd/link/internal/wasm/asm.go
src/cmd/link/link_test.go