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: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Hunknown = 0 + iota
Hdarwin
Hdragonfly
- Helf
Hfreebsd
Hlinux
Hnacl
}{
{"darwin", Hdarwin},
{"dragonfly", Hdragonfly},
- {"elf", Helf},
{"freebsd", Hfreebsd},
{"linux", Hlinux},
{"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android"
ld.Diag("unknown header type %d", ld.HEADTYPE)
fallthrough
- case obj.Hplan9,
- obj.Helf:
+ case obj.Hplan9:
break
case obj.Hdarwin:
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)
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()
}{
{"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"