aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/lib.go
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2024-03-13 17:46:29 +0000
committerThan McIntosh <thanm@google.com>2024-03-14 14:41:04 +0000
commitbe58fd00707a6e90cd868c279e0fd348a9ae7092 (patch)
treed03044ddd9ca4984489926fa3aad9d2ad89096b4 /src/cmd/link/internal/ld/lib.go
parent1e20af021ffe12efdaa3b82c7027af21d491457d (diff)
downloadgo-be58fd00707a6e90cd868c279e0fd348a9ae7092.tar.xz
Revert: "cmd/link: add option to enable full RELRO for ELF"
This reverts https://go.dev/cl/c/go/+/473495. Reason for revert: breaks some Google-internal tests. This revert will be temporary until we can gather more info on the nature of the failures and hopefully develop an upstream test case, etc. Updates #45681. Change-Id: Ib628ddc53bc5489e4f76c0f4ad809b75e899102c Reviewed-on: https://go-review.googlesource.com/c/go/+/571415 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/lib.go')
-rw-r--r--src/cmd/link/internal/ld/lib.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index c68da4070b..ae19896077 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1604,16 +1604,12 @@ func (ctxt *Link) hostlink() {
}
var altLinker string
- if ctxt.IsELF && (ctxt.DynlinkingGo() || *flagBindNow) {
- // For ELF targets, when producing dynamically linked Go code
- // or when immediate binding is explicitly requested,
- // we force all symbol resolution to be done at program startup
+ if ctxt.IsELF && ctxt.DynlinkingGo() {
+ // We force all symbol resolution to be done at program startup
// because lazy PLT resolution can use large amounts of stack at
// times we cannot allow it to do so.
argv = append(argv, "-Wl,-z,now")
- }
- if ctxt.IsELF && ctxt.DynlinkingGo() {
// Do not let the host linker generate COPY relocations. These
// can move symbols out of sections that rely on stable offsets
// from the beginning of the section (like sym.STYPE).