Commit 0e435347 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd: fix format strings used with obj.Headtype

Found by vet. Introduced by CL 28853.

Change-Id: I3199e0cbdb1c512ba29eb7e4d5c1c98963f5a954
Reviewed-on: https://go-review.googlesource.com/28957
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent f30598dd
...@@ -2188,7 +2188,7 @@ func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int { ...@@ -2188,7 +2188,7 @@ func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int {
if isAndroid { if isAndroid {
return 0x65 // GS return 0x65 // GS
} }
log.Fatalf("unknown TLS base register for %s", ctxt.Headtype) log.Fatalf("unknown TLS base register for %v", ctxt.Headtype)
case obj.Hdarwin, case obj.Hdarwin,
obj.Hdragonfly, obj.Hdragonfly,
...@@ -2201,7 +2201,7 @@ func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int { ...@@ -2201,7 +2201,7 @@ func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int {
switch ctxt.Headtype { switch ctxt.Headtype {
default: default:
log.Fatalf("unknown TLS base register for %s", ctxt.Headtype) log.Fatalf("unknown TLS base register for %v", ctxt.Headtype)
case obj.Hlinux: case obj.Hlinux:
if isAndroid { if isAndroid {
...@@ -4016,7 +4016,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) { ...@@ -4016,7 +4016,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
// are handled in prefixof above and should not be listed here. // are handled in prefixof above and should not be listed here.
switch ctxt.Headtype { switch ctxt.Headtype {
default: default:
log.Fatalf("unknown TLS base location for %s", ctxt.Headtype) log.Fatalf("unknown TLS base location for %v", ctxt.Headtype)
case obj.Hlinux, case obj.Hlinux,
obj.Hnacl: obj.Hnacl:
...@@ -4092,7 +4092,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) { ...@@ -4092,7 +4092,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
switch ctxt.Headtype { switch ctxt.Headtype {
default: default:
log.Fatalf("unknown TLS base location for %s", ctxt.Headtype) log.Fatalf("unknown TLS base location for %v", ctxt.Headtype)
case obj.Hlinux: case obj.Hlinux:
if !ctxt.Flag_shared { if !ctxt.Flag_shared {
......
...@@ -99,7 +99,7 @@ func archinit(ctxt *ld.Link) { ...@@ -99,7 +99,7 @@ func archinit(ctxt *ld.Link) {
ld.Linkmode = ld.LinkInternal ld.Linkmode = ld.LinkInternal
} }
if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" { if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" {
log.Fatalf("cannot use -linkmode=external with -H %s", ld.Headtype) log.Fatalf("cannot use -linkmode=external with -H %v", ld.Headtype)
} }
case obj.Hdarwin, case obj.Hdarwin,
......
...@@ -95,7 +95,7 @@ func archinit(ctxt *ld.Link) { ...@@ -95,7 +95,7 @@ func archinit(ctxt *ld.Link) {
ld.Linkmode = ld.LinkInternal ld.Linkmode = ld.LinkInternal
} }
if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" { if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" {
log.Fatalf("cannot use -linkmode=external with -H %s", ld.Headtype) log.Fatalf("cannot use -linkmode=external with -H %v", ld.Headtype)
} }
case obj.Hlinux, case obj.Hlinux,
......
...@@ -97,7 +97,7 @@ func archinit(ctxt *ld.Link) { ...@@ -97,7 +97,7 @@ func archinit(ctxt *ld.Link) {
ld.Linkmode = ld.LinkInternal ld.Linkmode = ld.LinkInternal
} }
if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" { if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" {
log.Fatalf("cannot use -linkmode=external with -H %s", ld.Headtype) log.Fatalf("cannot use -linkmode=external with -H %v", ld.Headtype)
} }
case obj.Hlinux, obj.Hdarwin: case obj.Hlinux, obj.Hdarwin:
break break
......
...@@ -429,7 +429,7 @@ func relocsym(ctxt *Link, s *Symbol) { ...@@ -429,7 +429,7 @@ func relocsym(ctxt *Link, s *Symbol) {
} else if Headtype == obj.Hwindows || Headtype == obj.Hwindowsgui { } else if Headtype == obj.Hwindows || Headtype == obj.Hwindowsgui {
o = r.Add o = r.Add
} else { } else {
log.Fatalf("unexpected R_TLS_LE relocation for %s", Headtype) log.Fatalf("unexpected R_TLS_LE relocation for %v", Headtype)
} }
case obj.R_TLS_IE: case obj.R_TLS_IE:
......
...@@ -60,7 +60,7 @@ func linknew(arch *sys.Arch) *Link { ...@@ -60,7 +60,7 @@ func linknew(arch *sys.Arch) *Link {
func (ctxt *Link) computeTLSOffset() { func (ctxt *Link) computeTLSOffset() {
switch Headtype { switch Headtype {
default: default:
log.Fatalf("unknown thread-local storage offset for %s", Headtype) log.Fatalf("unknown thread-local storage offset for %v", Headtype)
case obj.Hplan9, obj.Hwindows, obj.Hwindowsgui: case obj.Hplan9, obj.Hwindows, obj.Hwindowsgui:
break break
......
...@@ -105,7 +105,7 @@ func archinit(ctxt *ld.Link) { ...@@ -105,7 +105,7 @@ func archinit(ctxt *ld.Link) {
ld.Linkmode = ld.LinkInternal ld.Linkmode = ld.LinkInternal
} }
if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" { if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" {
log.Fatalf("cannot use -linkmode=external with -H %s", ld.Headtype) log.Fatalf("cannot use -linkmode=external with -H %v", ld.Headtype)
} }
case obj.Hlinux: case obj.Hlinux:
......
...@@ -120,7 +120,7 @@ func archinit(ctxt *ld.Link) { ...@@ -120,7 +120,7 @@ func archinit(ctxt *ld.Link) {
ld.Linkmode = ld.LinkInternal ld.Linkmode = ld.LinkInternal
} }
if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" { if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" {
log.Fatalf("cannot use -linkmode=external with -H %s", ld.Headtype) log.Fatalf("cannot use -linkmode=external with -H %v", ld.Headtype)
} }
case obj.Hlinux: case obj.Hlinux:
......
...@@ -98,7 +98,7 @@ func archinit(ctxt *ld.Link) { ...@@ -98,7 +98,7 @@ func archinit(ctxt *ld.Link) {
ld.Linkmode = ld.LinkInternal ld.Linkmode = ld.LinkInternal
} }
if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" { if ld.Linkmode == ld.LinkExternal && obj.Getgoextlinkenabled() != "1" {
log.Fatalf("cannot use -linkmode=external with -H %s", ld.Headtype) log.Fatalf("cannot use -linkmode=external with -H %v", ld.Headtype)
} }
case obj.Hdarwin, case obj.Hdarwin,
......
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