]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix size of filetab slice
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 27 Oct 2015 01:49:51 +0000 (14:49 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 11 Nov 2015 23:17:25 +0000 (23:17 +0000)
commitcf125a36d50397b1a1821304a33fd6fa7e3cf4cd
tree9311e278355d8500529057898bd0800ffa395256
parentb2259dcef0ba93f11e63b0bc55930c150ac1b610
cmd/link: fix size of filetab slice

The linker writes the number of file symbols (Nhistfile) to the filetab slice
and then Nhistfile offsets -- which means the slice contains Nhistfile+1
entries, not just Nhistfile.

I think this bug has been around since at least 1.4 but it's easier to trigger
with shared libraries and a tiny binary that only has a couple of functions in
it -- try go install -buildmode=shared std && go run -linkshared test/fixedbugs/issue4388.go.

Change-Id: I6c0f01f1e607b9b2b96872e37ffce81281911504
Reviewed-on: https://go-review.googlesource.com/16342
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/symtab.go