]> Cypherpunks repositories - gostls13.git/commit
cmd/link: move .dynamic and .got sections to relro if applicable
authorThan McIntosh <thanm@google.com>
Wed, 13 Mar 2024 19:03:43 +0000 (19:03 +0000)
committerThan McIntosh <thanm@google.com>
Mon, 22 Apr 2024 13:29:54 +0000 (13:29 +0000)
commit2dddc7ef881669276c96356ec44c4e46ec20b1e9
tree01c84bf6e5a2c56ed33aa3eb4251ed207fc504ea
parent7f76c00fc5678fa782708ba8fece63750cb89d03
cmd/link: move .dynamic and .got sections to relro if applicable

This is the second of two CLs to roll forward the changes in CL
473495, which was subsequently reverted.

In this patch we move the .dynamic and .got sections from the writable
data segment to the relro segment if the platform supports relro and
we're producing a PIE binary, and also moves .got.plt into relro if
eager binding is in effect (e.g. -bindnow or -Wl,-z,now).

Updates #45681.

Change-Id: I9f4fba6e825b96d1b5e27fb75844450dd0a650b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/571417
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
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/sym/symkind.go
src/cmd/link/internal/sym/symkind_string.go