From: Austin Clements Date: Mon, 3 Nov 2014 22:24:13 +0000 (-0500) Subject: [dev.power64] liblink: fix printing of branch targets X-Git-Tag: go1.5beta1~2684^2~11^2~14 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=473bfae5ae3c4adccebc14bca40d0fb0a2ff09ab;p=gostls13.git [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 --- diff --git a/src/liblink/list9.c b/src/liblink/list9.c index 041c6884f1..c9190d8940 100644 --- a/src/liblink/list9.c +++ b/src/liblink/list9.c @@ -259,11 +259,12 @@ Dconv(Fmt *fp) sprint(str, "%s+%.5lux(BRANCH)", a->sym->name, v); else sprint(str, "%.5lux(BRANCH)", v); - } else - if(a->sym != nil) - sprint(str, "%s+%lld(APC)", a->sym->name, a->offset); - else - sprint(str, "%lld(APC)", a->offset); + } else if(a->u.branch != nil) + sprint(str, "%lld", a->u.branch->pc); + else if(a->sym != nil) + sprint(str, "%s+%lld(APC)", a->sym->name, a->offset); + else + sprint(str, "%lld(APC)", a->offset); break; case D_FCONST: