diff options
author | Austin Clements <austin@google.com> | 2014-11-03 17:24:13 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2014-11-03 17:24:13 -0500 |
commit | 9f8cf50faf3b9b087c875779e57ffeaa9d0b6309 (patch) | |
tree | 4beb20dd9b3479bed6e96a7a6c415ec15ae3ba5a | |
parent | 56a0d66982aa63a0fe093f4182c05728f8000887 (diff) | |
download | go-9f8cf50faf3b9b087c875779e57ffeaa9d0b6309.tar.gz |
[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://codereview.appspot.com/168980043
-rw-r--r-- | src/liblink/list9.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/liblink/list9.c b/src/liblink/list9.c index 041c6884f..c9190d894 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: |