From: Russ Cox Date: Wed, 4 Mar 2015 21:50:59 +0000 (-0500) Subject: runtime: poison pcln.frame value X-Git-Tag: go1.5beta1~1699 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a0ac493852e22408114d530105ffe89dc7dba98b;p=gostls13.git runtime: poison pcln.frame value Nothing uses it, nothing should start using it. Stop leaving plausible-looking values there. It would be nice to remove entirely, but that would require a new version number for the object file format, in order not to break external readers like debug/gosym. It's easier to leave and poison. I came across an old mail thread suggesting we start using it to speed up tracebacks. I want to make sure that doesn't happen. (The values there were never quite right, and the number is fundamentally PC-specific anyway.) Change-Id: Iaf38e8a6b523cbae30b69c28497c4588ef397519 Reviewed-on: https://go-review.googlesource.com/6890 Reviewed-by: Minux Ma --- diff --git a/src/cmd/internal/ld/pcln.go b/src/cmd/internal/ld/pcln.go index a74143d9fd..0250ca0eb8 100644 --- a/src/cmd/internal/ld/pcln.go +++ b/src/cmd/internal/ld/pcln.go @@ -231,7 +231,6 @@ func pclntab() { nfunc = 0 var last *LSym var end int32 - var frameptrsize int32 var funcstart int32 var i int32 var it Pciter @@ -273,17 +272,11 @@ func pclntab() { off = int32(setuint32(Ctxt, ftab, int64(off), uint32(Ctxt.Cursym.Args))) // frame int32 - // TODO: Remove entirely. The pcsp table is more precise. - // This is only used by a fallback case during stack walking - // when a called function doesn't have argument information. - // We need to make sure everything has argument information - // and then remove this. - frameptrsize = int32(Thearch.Ptrsize) - - if Ctxt.Cursym.Leaf != 0 { - frameptrsize = 0 - } - off = int32(setuint32(Ctxt, ftab, int64(off), uint32(Ctxt.Cursym.Locals)+uint32(frameptrsize))) + // This has been removed (it was never set quite correctly anyway). + // Nothing should use it. + // Leave an obviously incorrect value. + // TODO: Remove entirely. + off = int32(setuint32(Ctxt, ftab, int64(off), 0x1234567)) if pcln != &pclntab_zpcln { renumberfiles(Ctxt, pcln.File, &pcln.Pcfile)