1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:40:22 -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) */
o1 = c.opbrr(p, p.As)
o1 |= uint32(p.To.Reg&31) << 5
if p.As == obj.ACALL {
rel := obj.Addrel(c.cursym)
rel.Off = int32(c.pc)
rel.Siz = 0
rel.Type = objabi.R_CALLIND
}
case 7: /* beq s */
o1 = c.opbra(p, p.As)