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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 758447cd
...@@ -716,7 +716,6 @@ const ( ...@@ -716,7 +716,6 @@ const (
Hunknown = 0 + iota Hunknown = 0 + iota
Hdarwin Hdarwin
Hdragonfly Hdragonfly
Helf
Hfreebsd Hfreebsd
Hlinux Hlinux
Hnacl Hnacl
......
...@@ -44,7 +44,6 @@ var headers = []struct { ...@@ -44,7 +44,6 @@ var headers = []struct {
}{ }{
{"darwin", Hdarwin}, {"darwin", Hdarwin},
{"dragonfly", Hdragonfly}, {"dragonfly", Hdragonfly},
{"elf", Helf},
{"freebsd", Hfreebsd}, {"freebsd", Hfreebsd},
{"linux", Hlinux}, {"linux", Hlinux},
{"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android" {"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android"
......
...@@ -671,8 +671,7 @@ func asmb() { ...@@ -671,8 +671,7 @@ func asmb() {
ld.Diag("unknown header type %d", ld.HEADTYPE) ld.Diag("unknown header type %d", ld.HEADTYPE)
fallthrough fallthrough
case obj.Hplan9, case obj.Hplan9:
obj.Helf:
break break
case obj.Hdarwin: case obj.Hdarwin:
...@@ -702,8 +701,7 @@ func asmb() { ...@@ -702,8 +701,7 @@ func asmb() {
ld.Bso.Flush() ld.Bso.Flush()
switch ld.HEADTYPE { switch ld.HEADTYPE {
default: default:
case obj.Hplan9, case obj.Hplan9:
obj.Helf:
ld.Debug['s'] = 1 ld.Debug['s'] = 1
symo = int64(ld.Segdata.Fileoff + ld.Segdata.Filelen) symo = int64(ld.Segdata.Fileoff + ld.Segdata.Filelen)
......
...@@ -136,19 +136,6 @@ func archinit() { ...@@ -136,19 +136,6 @@ func archinit() {
ld.INITRND = 0x200000 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 */ case obj.Hdarwin: /* apple MACH */
ld.Machoinit() ld.Machoinit()
......
...@@ -43,7 +43,6 @@ var headers = []struct { ...@@ -43,7 +43,6 @@ var headers = []struct {
}{ }{
{"darwin", obj.Hdarwin}, {"darwin", obj.Hdarwin},
{"dragonfly", obj.Hdragonfly}, {"dragonfly", obj.Hdragonfly},
{"elf", obj.Helf},
{"freebsd", obj.Hfreebsd}, {"freebsd", obj.Hfreebsd},
{"linux", obj.Hlinux}, {"linux", obj.Hlinux},
{"android", obj.Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android" {"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