]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: remove -H elf flag
authorMatthew Dempsky <mdempsky@google.com>
Thu, 31 Mar 2016 05:56:00 +0000 (22:56 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 31 Mar 2016 06:33:01 +0000 (06:33 +0000)
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>

src/cmd/internal/obj/link.go
src/cmd/internal/obj/sym.go
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/amd64/obj.go
src/cmd/link/internal/ld/sym.go

index 152a2acea00e9a0c9d6e83b2e65db4c27e0b5d86..cfe7c958cdd9b5c960a3627c31745eeb11d3b0c7 100644 (file)
@@ -716,7 +716,6 @@ const (
        Hunknown = 0 + iota
        Hdarwin
        Hdragonfly
-       Helf
        Hfreebsd
        Hlinux
        Hnacl
index a723eb4689d7643c6c0f5e19107177dccbc7b6b1..64df62a2ae500d7062ea2f9135455816ad3c3379 100644 (file)
@@ -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"
index 274e246fbc1fdfa64f9072a3ffb2bcaa4d59c8f6..d809f6e8ed2b11d0c3b809426c0c178ae8bb06d8 100644 (file)
@@ -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)
 
index f5c2756fe714d1035ee0807ec65cedc2ee3eb485..f9e13f2e18c2a60257c76eb879e720a803760ea9 100644 (file)
@@ -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()
 
index 486b88152001a25eb4cea77a93af058785a874a8..3deb94644e65a978721f2fa944c7c6a83ee10333 100644 (file)
@@ -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"