Commit 1dad218d authored by David Crawshaw's avatar David Crawshaw

cmd/link: move declarations into loops

(Split out from CL 22205.)

Change-Id: Id32698f48ce02b55c15b6f2842215e0ffdbf425b
Reviewed-on: https://go-review.googlesource.com/22298Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d8c9dd60
......@@ -1692,8 +1692,6 @@ func elfrelocsect(sect *Section, first *LSym) {
}
eaddr := int32(sect.Vaddr + sect.Length)
var r *Reloc
var ri int
for ; sym != nil; sym = sym.Next {
if !sym.Attr.Reachable() {
continue
......@@ -1703,8 +1701,8 @@ func elfrelocsect(sect *Section, first *LSym) {
}
Ctxt.Cursym = sym
for ri = 0; ri < len(sym.R); ri++ {
r = &sym.R[ri]
for ri := 0; ri < len(sym.R); ri++ {
r := &sym.R[ri]
if r.Done != 0 {
continue
}
......
......@@ -824,8 +824,6 @@ func machorelocsect(sect *Section, first *LSym) {
}
eaddr := int32(sect.Vaddr + sect.Length)
var r *Reloc
var ri int
for ; sym != nil; sym = sym.Next {
if !sym.Attr.Reachable() {
continue
......@@ -835,8 +833,8 @@ func machorelocsect(sect *Section, first *LSym) {
}
Ctxt.Cursym = sym
for ri = 0; ri < len(sym.R); ri++ {
r = &sym.R[ri]
for ri := 0; ri < len(sym.R); ri++ {
r := &sym.R[ri]
if r.Done != 0 {
continue
}
......
......@@ -784,8 +784,6 @@ func perelocsect(sect *Section, first *LSym) int {
}
eaddr := int32(sect.Vaddr + sect.Length)
var r *Reloc
var ri int
for ; sym != nil; sym = sym.Next {
if !sym.Attr.Reachable() {
continue
......@@ -795,8 +793,8 @@ func perelocsect(sect *Section, first *LSym) int {
}
Ctxt.Cursym = sym
for ri = 0; ri < len(sym.R); ri++ {
r = &sym.R[ri]
for ri := 0; ri < len(sym.R); ri++ {
r := &sym.R[ri]
if r.Done != 0 {
continue
}
......
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