aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/internal/obj/plist.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/plist.go b/src/cmd/internal/obj/plist.go
index 348a16356e..e5bbdd51a7 100644
--- a/src/cmd/internal/obj/plist.go
+++ b/src/cmd/internal/obj/plist.go
@@ -54,11 +54,28 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string
if curtext == nil { // func _() {}
continue
}
- if p.To.Sym.Name == "go_args_stackmap" {
+ switch p.To.Sym.Name {
+ case "go_args_stackmap":
if p.From.Type != TYPE_CONST || p.From.Offset != objabi.FUNCDATA_ArgsPointerMaps {
ctxt.Diag("FUNCDATA use of go_args_stackmap(SB) without FUNCDATA_ArgsPointerMaps")
}
p.To.Sym = ctxt.LookupDerived(curtext, curtext.Name+".args_stackmap")
+ case "no_pointers_stackmap":
+ if p.From.Type != TYPE_CONST || p.From.Offset != objabi.FUNCDATA_LocalsPointerMaps {
+ ctxt.Diag("FUNCDATA use of no_pointers_stackmap(SB) without FUNCDATA_LocalsPointerMaps")
+ }
+ // funcdata for functions with no local variables in frame.
+ // Define two zero-length bitmaps, because the same index is used
+ // for the local variables as for the argument frame, and assembly
+ // frames have two argument bitmaps, one without results and one with results.
+ // Write []uint32{2, 0}.
+ b := make([]byte, 8)
+ ctxt.Arch.ByteOrder.PutUint32(b, 2)
+ s := ctxt.GCLocalsSym(b)
+ if !s.OnList() {
+ ctxt.Globl(s, int64(len(s.P)), int(RODATA|DUPOK))
+ }
+ p.To.Sym = s
}
}