Commit 4b175fd2 authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

cmd/link: fix Codeblk printing when -a to use Textp as a slice

Does anyone actually pass -a to the linker?

Change-Id: I1d31ea66aa5604b7fd42adf15bdab71e9f52d0ed
Reviewed-on: https://go-review.googlesource.com/22356
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
parent 0ef041cf
...@@ -798,19 +798,20 @@ func Codeblk(addr int64, size int64) { ...@@ -798,19 +798,20 @@ func Codeblk(addr int64, size int64) {
return return
} }
var sym *LSym syms := Ctxt.Textp
for _, sym = range Ctxt.Textp { for i, sym := range syms {
if !sym.Attr.Reachable() { if !sym.Attr.Reachable() {
continue continue
} }
if sym.Value >= addr { if sym.Value >= addr {
syms = syms[i:]
break break
} }
} }
eaddr := addr + size eaddr := addr + size
var q []byte var q []byte
for ; sym != nil; sym = sym.Next { for _, sym := range syms {
if !sym.Attr.Reachable() { if !sym.Attr.Reachable() {
continue 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