]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/{arm,s390x}: make return jump print nicer
authorCherry Zhang <cherryyz@google.com>
Thu, 22 Oct 2020 01:29:43 +0000 (21:29 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 26 Oct 2020 19:15:06 +0000 (19:15 +0000)
commit751c37fd629e0ebb18c39a219fab2b224d016b70
tree1f291e7e14839667680ab7bb3189c40d7fb1d309
parenta8b28ebc87854fb6f2ba99f415f046dc2ff63604
cmd/internal/obj/{arm,s390x}: make return jump print nicer

When a function with non-zero frame size makes a return jump
(RET target), it assembles to, conceptually,

MOV (SP), LR
ADD $framesize, SP
JMP target

We did not clear some fields in the first instruction's Prog.To,
causing it printed like (on ARM)

MOVW.P 4(R13), (R14)(R14)(REG)

Clear the fields to make it print nicer.

Change-Id: I180901aeea41f1ff287d7c6034a6d69005927744
Reviewed-on: https://go-review.googlesource.com/c/go/+/264343
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
src/cmd/internal/obj/arm/obj5.go
src/cmd/internal/obj/s390x/objz.go