[dev.link] cmd/link: remove safe mode

Safe mode in the compiler is removed in CL 142717 in Go 1.12. I
think we can delete safe mode from the linker as well.

Change-Id: I201e84fca3a566a1bb84434ab4d504516160ac4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/236117
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2020-06-01 12:55:40 -04:00
parent 086828ac55
commit 4cc043d883
4 changed files with 0 additions and 32 deletions

View file

@ -995,21 +995,6 @@ func loadobjfile(ctxt *Link, lib *sym.Library) {
if pkg == "main" && !lib.Main {
Exitf("%s: not package main", lib.File)
}
// Ideally, we'd check that *all* object files within
// the archive were marked safe, but here we settle
// for *any*.
//
// Historically, cmd/link only checked the __.PKGDEF
// file, which in turn came from the first object
// file, typically produced by cmd/compile. The
// remaining object files are normally produced by
// cmd/asm, which doesn't support marking files as
// safe anyway. So at least in practice, this matches
// how safe mode has always worked.
if *flagU && !lib.Safe {
Exitf("%s: load of unsafe package %s", lib.File, pkg)
}
}()
for i := 0; i < len(ARMAG); i++ {