1
0
mirror of https://github.com/golang/go synced 2024-11-23 12:20:12 -07:00

cmd/internal/obj/arm64: only emit R_CALLIND relocations on calls

Don't emit it for jumps. In particular, not for the return
instruction, which is JMP (LR).

Reduce some binary size and linker resources.

Change-Id: Idb3242b86c5a137597fb8accb8aadfe0244c14cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/260341
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2020-10-07 14:39:47 -04:00
parent ade5161f51
commit 3f7b4d1207

View File

@ -3120,12 +3120,13 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
case 6: /* b ,O(R); bl ,O(R) */ case 6: /* b ,O(R); bl ,O(R) */
o1 = c.opbrr(p, p.As) o1 = c.opbrr(p, p.As)
o1 |= uint32(p.To.Reg&31) << 5 o1 |= uint32(p.To.Reg&31) << 5
rel := obj.Addrel(c.cursym) if p.As == obj.ACALL {
rel.Off = int32(c.pc) rel := obj.Addrel(c.cursym)
rel.Siz = 0 rel.Off = int32(c.pc)
rel.Type = objabi.R_CALLIND rel.Siz = 0
rel.Type = objabi.R_CALLIND
}
case 7: /* beq s */ case 7: /* beq s */
o1 = c.opbra(p, p.As) o1 = c.opbra(p, p.As)