Commit 71ab3c1c authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/link: remove -H elf flag

We create appropriate ELF files automatically based on GOOS. There's
no point in supporting -H elf flag, particularly since we need to emit
different flavors of ELF depending on GOOS anyway.

If that weren't reason enough, -H elf appears to be broken since at
least Go 1.4. At least I wasn't able to find a way to make use of it.

As best I can tell digging through commit history, -H elf is just an
artifact leftover from Plan 9's 6l linker.

Change-Id: I7393caaadbc60107bbd6bc99b976a4f4fe6b5451
Reviewed-on: https://go-review.googlesource.com/21343
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 758447cd
......@@ -716,7 +716,6 @@ const (
Hunknown = 0 + iota
Hdarwin
Hdragonfly
Helf
Hfreebsd
Hlinux
Hnacl
......
......@@ -44,7 +44,6 @@ var headers = []struct {
}{
{"darwin", Hdarwin},
{"dragonfly", Hdragonfly},
{"elf", Helf},
{"freebsd", Hfreebsd},
{"linux", Hlinux},
{"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android"
......
......@@ -671,8 +671,7 @@ func asmb() {
ld.Diag("unknown header type %d", ld.HEADTYPE)
fallthrough
case obj.Hplan9,
obj.Helf:
case obj.Hplan9:
break
case obj.Hdarwin:
......@@ -702,8 +701,7 @@ func asmb() {
ld.Bso.Flush()
switch ld.HEADTYPE {
default:
case obj.Hplan9,
obj.Helf:
case obj.Hplan9:
ld.Debug['s'] = 1
symo = int64(ld.Segdata.Fileoff + ld.Segdata.Filelen)
......
......@@ -136,19 +136,6 @@ func archinit() {
ld.INITRND = 0x200000
}
case obj.Helf: /* elf32 executable */
ld.HEADR = int32(ld.Rnd(52+3*32, 16))
if ld.INITTEXT == -1 {
ld.INITTEXT = 0x80110000
}
if ld.INITDAT == -1 {
ld.INITDAT = 0
}
if ld.INITRND == -1 {
ld.INITRND = 4096
}
case obj.Hdarwin: /* apple MACH */
ld.Machoinit()
......
......@@ -43,7 +43,6 @@ var headers = []struct {
}{
{"darwin", obj.Hdarwin},
{"dragonfly", obj.Hdragonfly},
{"elf", obj.Helf},
{"freebsd", obj.Hfreebsd},
{"linux", obj.Hlinux},
{"android", obj.Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment