]> Cypherpunks repositories - gostls13.git/commit
cmd/link: detect trampoline of deferreturn call
authorCherry Zhang <cherryyz@google.com>
Thu, 14 May 2020 23:22:59 +0000 (19:22 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 15 May 2020 16:15:25 +0000 (16:15 +0000)
commit2b70ffe9307c0992e28513ba25081d767b5937b2
treeb916625b07f94a4c8bc2daac9380bbf327394352
parent881d5405402d6e8c54f83eed6216a9ed29778006
cmd/link: detect trampoline of deferreturn call

The runtime needs to find the PC of the deferreturn call in a few
places. So for functions that have defer, we record the PC of
deferreturn call in its funcdata.

For very large binaries, the deferreturn call could be made
through a trampoline. The current code of finding deferreturn PC
fails in this case. This CL handles the trampoline as well.

Fixes #39049.

Change-Id: I929be54d6ae436f5294013793217dc2a35f080d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/234105
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/ld/pcln.go
src/cmd/link/internal/loader/loader.go
src/cmd/link/internal/ppc64/asm.go
src/cmd/link/link_test.go