Commit 473bfae5 authored by Austin Clements's avatar Austin Clements

[dev.power64] liblink: fix printing of branch targets

Print PC stored in target Prog* of branch instructions when
available instead of the offset stored in the branch
instruction.  The offset tends to be wrong after code
transformations, so previously this led to confusing listings.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/168980043
parent 81001928
...@@ -259,8 +259,9 @@ Dconv(Fmt *fp) ...@@ -259,8 +259,9 @@ Dconv(Fmt *fp)
sprint(str, "%s+%.5lux(BRANCH)", a->sym->name, v); sprint(str, "%s+%.5lux(BRANCH)", a->sym->name, v);
else else
sprint(str, "%.5lux(BRANCH)", v); sprint(str, "%.5lux(BRANCH)", v);
} else } else if(a->u.branch != nil)
if(a->sym != nil) sprint(str, "%lld", a->u.branch->pc);
else if(a->sym != nil)
sprint(str, "%s+%lld(APC)", a->sym->name, a->offset); sprint(str, "%s+%lld(APC)", a->sym->name, a->offset);
else else
sprint(str, "%lld(APC)", a->offset); sprint(str, "%lld(APC)", a->offset);
......
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