Skip to content

Commit

Permalink
cmd/link: fix number-of-files entry in gopclntab
Browse files Browse the repository at this point in the history
According to golang.org/s/go12symtab, for N files, it should put N+1
there.

Fixes golang#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>
  • Loading branch information
cherrymui committed Sep 16, 2016
1 parent 544010a commit bb12894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/link/internal/ld/pcln.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit bb12894

Please sign in to comment.