]> Cypherpunks repositories - gostls13.git/commit
cmd/link: move pclntab out of relro section
authorIan Lance Taylor <iant@golang.org>
Thu, 6 Nov 2025 00:13:22 +0000 (16:13 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 6 Nov 2025 17:58:44 +0000 (09:58 -0800)
commitad3ccd92e4c2ddfc1499a5e038eb0aa0012c0dda
treea89987bce695acf2606d55818d42ad42fdf9f2af
parent43b91e7abd1c3b84c919c97bca30480d2610f9ec
cmd/link: move pclntab out of relro section

The .gopclntab section should not have any relocations.
Move it out of relro to regular rodata.

Note that this is tested by tests like TestNoTextrel in
cmd/cgo/internal/testshared.

The existing test TestMachoSectionsReadOnly looks for sections in a
Mach-O file that are read-only after relocations are applied
(this is marked by a segment with a flags field set to 0x10).
We remove the __gopclntab section, as that section is now read-only
at all times, not only after relocating.

For #76038

Change-Id: I7f837e423bf1e802509277f5dc7fdd1ed0228e32
Reviewed-on: https://go-review.googlesource.com/c/go/+/718065
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/elf_test.go
src/cmd/link/internal/ld/macho_test.go
src/cmd/link/internal/sym/symkind.go
src/cmd/link/internal/sym/symkind_string.go