1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:04:43 -07:00

cmd/link: fix number-of-files entry in gopclntab

According to golang.org/s/go12symtab, for N files, it should put N+1
there.

Fixes #17132.

Change-Id: I0c84136855c6436be72b9d3c407bf10d4c81a099
Reviewed-on: https://go-review.googlesource.com/29275
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Cherry Zhang 2016-09-15 19:52:40 -04:00
parent 544010a05a
commit bb12894d2b

View File

@ -358,7 +358,7 @@ func (ctxt *Link) pclntab() {
setuint32(ctxt, ftab, 8+int64(SysArch.PtrSize)+int64(nfunc)*2*int64(SysArch.PtrSize)+int64(SysArch.PtrSize), uint32(start))
Symgrow(ctxt, ftab, int64(start)+(int64(len(ctxt.Filesyms))+1)*4)
setuint32(ctxt, ftab, int64(start), uint32(len(ctxt.Filesyms)))
setuint32(ctxt, ftab, int64(start), uint32(len(ctxt.Filesyms)+1))
for i := len(ctxt.Filesyms) - 1; i >= 0; i-- {
s := ctxt.Filesyms[i]
setuint32(ctxt, ftab, int64(start)+s.Value*4, uint32(ftabaddstring(ctxt, ftab, s.Name)))