]> Cypherpunks repositories - gostls13.git/commit
cmd/link: add option to enable full RELRO for ELF
authorNick Revin <n@nrvn.cc>
Mon, 26 Feb 2024 19:54:41 +0000 (19:54 +0000)
committerCherry Mui <cherryyz@google.com>
Thu, 29 Feb 2024 16:38:32 +0000 (16:38 +0000)
commit45b641ce15159e29fa4494b837493042d1e10384
tree7f440b47ba1af88b9c9b41fbe2eb8f907dd1384b
parent0784fd1b2f6050b8fb91c88c1d02107258a1651a
cmd/link: add option to enable full RELRO for ELF

-bindnow linker option enables full RELRO on ELF targets.

This options defaults to false and preserves
current behavior - partial relro for buildmode=pie.

Also, the following changes were made to align
internal linker's behavior with external ELF linkers:
- GNU_RELRO segment is marked Read-only
- .dynamic is a relro section for partial and full RELRO
- .got is a relro section for partial and full RELRO
- .got.plt is a relro section for full RELRO only

Supersedes #45681 (golang.org/cl/312509)

Change-Id: I51c4ef07b14beceb7cd6fd989f323e45f89a63ca
GitHub-Last-Rev: bc6826441065395b80a2b66cde67466c4d9bce2e
GitHub-Pull-Request: golang/go#58869
Reviewed-on: https://go-review.googlesource.com/c/go/+/473495
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/work/security.go
src/cmd/go/internal/work/security_test.go
src/cmd/link/doc.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/elf_test.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/main.go
src/internal/testenv/testenv.go