mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj: don't emit args_stackmap for ABIInternal asm funcs
The compiler currently emits an "*.args_stackmap" symbol for all bodyless functions, so that asm functions will have the proper stack map. At the moment the code in the compiler that emits args_stackmap assumes ABI0; to avoid misleading stackmaps, turn off args_stackmap generation for non-ABI0 asm functions. Updates #40724. Change-Id: Ia5e3528d56da5fb107e799bd658e52496ba4a331 Reviewed-on: https://go-review.googlesource.com/c/go/+/309790 Trust: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
25b25a9ed7
commit
4480c822ba
1 changed files with 7 additions and 1 deletions
|
|
@ -85,6 +85,13 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string
|
||||||
// wrapper function
|
// wrapper function
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// The current args_stackmap generation in the compiler assumes
|
||||||
|
// that the function in question is ABI0, so avoid introducing
|
||||||
|
// an args_stackmap reference if the func is not ABI0 (better to
|
||||||
|
// have no stackmap than an incorrect/lying stackmap).
|
||||||
|
if s.ABI() != ABI0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
found := false
|
found := false
|
||||||
for p := s.Func().Text; p != nil; p = p.Link {
|
for p := s.Func().Text; p != nil; p = p.Link {
|
||||||
if p.As == AFUNCDATA && p.From.Type == TYPE_CONST && p.From.Offset == objabi.FUNCDATA_ArgsPointerMaps {
|
if p.As == AFUNCDATA && p.From.Type == TYPE_CONST && p.From.Offset == objabi.FUNCDATA_ArgsPointerMaps {
|
||||||
|
|
@ -92,7 +99,6 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
p := Appendp(s.Func().Text, newprog)
|
p := Appendp(s.Func().Text, newprog)
|
||||||
p.As = AFUNCDATA
|
p.As = AFUNCDATA
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue