cmd/link: remove unused flag -D (FlagDataAddr)

FlagDataAddr is a vestige from git commit 0cafb9e (2008;
no Gerrit CL number).

It was never used but unfortunately setting it would
cause a spurious warning:

  warning: -D<value> is ignored because of -R0x1000

yet if -R was unset e.g. -R=0, the linker would crash
with a divide by zero runtime panic.

Fixes #28921

Change-Id: Ia910399bc269337a9a860f3a26cd48fae6e62724
Reviewed-on: https://go-review.googlesource.com/c/151021
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Alex Tokarev 2018-11-23 13:45:51 +07:00 committed by Brad Fitzpatrick
parent aafa855fd3
commit db2b6e1566
11 changed files with 4 additions and 126 deletions

View file

@ -88,7 +88,6 @@ var (
FlagRound = flag.Int("R", -1, "set address rounding `quantum`")
FlagTextAddr = flag.Int64("T", -1, "set text segment `address`")
FlagDataAddr = flag.Int64("D", -1, "set data segment `address`")
flagEntrySymbol = flag.String("E", "", "set `entry` symbol name")
cpuprofile = flag.String("cpuprofile", "", "write cpu profile to `file`")
@ -181,7 +180,7 @@ func Main(arch *sys.Arch, theArch Arch) {
}
if ctxt.Debugvlog != 0 {
ctxt.Logf("HEADER = -H%d -T0x%x -D0x%x -R0x%x\n", ctxt.HeadType, uint64(*FlagTextAddr), uint64(*FlagDataAddr), uint32(*FlagRound))
ctxt.Logf("HEADER = -H%d -T0x%x -R0x%x\n", ctxt.HeadType, uint64(*FlagTextAddr), uint32(*FlagRound))
}
switch ctxt.BuildMode {