1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:54:59 -07:00

[dev.link] cmd/link: remove Flag8 from amd64

It's only ever checked for plan 9 and it was irrelevantly set.

Change-Id: I225d4be645f573ceccde47ec2236bf3dbeb0ea70
Reviewed-on: https://go-review.googlesource.com/c/go/+/234886
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Jeremy Faller 2020-05-21 16:33:20 -04:00
parent c551318046
commit 0ca6098f70
3 changed files with 3 additions and 7 deletions

View File

@ -690,16 +690,12 @@ func asmb2(ctxt *ld.Link, _ *loader.Loader) {
fallthrough fallthrough
case objabi.Hplan9: case objabi.Hplan9:
break
case objabi.Hlinux, case objabi.Hlinux,
objabi.Hfreebsd, objabi.Hfreebsd,
objabi.Hnetbsd, objabi.Hnetbsd,
objabi.Hopenbsd, objabi.Hopenbsd,
objabi.Hdragonfly, objabi.Hdragonfly,
objabi.Hsolaris: objabi.Hsolaris:
ld.Flag8 = true /* 64-bit addresses */
case objabi.Hwindows: case objabi.Hwindows:
break break
} }

View File

@ -84,7 +84,7 @@ var (
FlagS = flag.Bool("s", false, "disable symbol table") FlagS = flag.Bool("s", false, "disable symbol table")
flagU = flag.Bool("u", false, "reject unsafe packages") flagU = flag.Bool("u", false, "reject unsafe packages")
FlagW = flag.Bool("w", false, "disable DWARF generation") FlagW = flag.Bool("w", false, "disable DWARF generation")
Flag8 bool // use 64-bit addresses in symbol table flag8 bool // use 64-bit addresses in symbol table
flagInterpreter = flag.String("I", "", "use `linker` as ELF dynamic linker") flagInterpreter = flag.String("I", "", "use `linker` as ELF dynamic linker")
FlagDebugTramp = flag.Int("debugtramp", 0, "debug trampolines") FlagDebugTramp = flag.Int("debugtramp", 0, "debug trampolines")
FlagStrictDups = flag.Int("strictdups", 0, "sanity check duplicate symbol contents during object file reading (1=warn 2=err).") FlagStrictDups = flag.Int("strictdups", 0, "sanity check duplicate symbol contents during object file reading (1=warn 2=err).")
@ -121,7 +121,7 @@ func Main(arch *sys.Arch, theArch Arch) {
// TODO(matloob): define these above and then check flag values here // TODO(matloob): define these above and then check flag values here
if ctxt.Arch.Family == sys.AMD64 && objabi.GOOS == "plan9" { if ctxt.Arch.Family == sys.AMD64 && objabi.GOOS == "plan9" {
flag.BoolVar(&Flag8, "8", false, "use 64-bit addresses in symbol table") flag.BoolVar(&flag8, "8", false, "use 64-bit addresses in symbol table")
} }
flagHeadType := flag.String("H", "", "set header `type`") flagHeadType := flag.String("H", "", "set header `type`")
flag.BoolVar(&ctxt.linkShared, "linkshared", false, "link against installed Go shared libraries") flag.BoolVar(&ctxt.linkShared, "linkshared", false, "link against installed Go shared libraries")

View File

@ -259,7 +259,7 @@ func putplan9sym(ctxt *Link, ldr *loader.Loader, s loader.Sym, char SymbolType)
} }
l := 4 l := 4
addr := ldr.SymValue(s) addr := ldr.SymValue(s)
if ctxt.IsAMD64() && !Flag8 { if ctxt.IsAMD64() && !flag8 {
ctxt.Out.Write32b(uint32(addr >> 32)) ctxt.Out.Write32b(uint32(addr >> 32))
l = 8 l = 8
} }