]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] cmd/internal/goobj2: fix buglet in object file reader
authorThan McIntosh <thanm@google.com>
Tue, 15 Dec 2020 20:54:25 +0000 (15:54 -0500)
committerCarlos Amedee <carlos@golang.org>
Tue, 2 Feb 2021 22:36:08 +0000 (22:36 +0000)
commit58dc4452620ebefa75742661c538b8406b213b4a
treef9d151454f766752f0492ef8b9ec4a939e932598
parentaa9b48cd1837644a1555fd7a370800924cef627a
[release-branch.go1.15] cmd/internal/goobj2: fix buglet in object file reader

The code in the Go object file reader was casting a pointer to mmaped
memory into a large array prior to performing a read of the
relocations section:

return (*[1<<20]Reloc)(unsafe.Pointer(&r.b[off]))[:n:n]

For very large object files, this artificial array isn't large enough
(that is, there are more than 1048576 relocs to read), so update the
code to use a larger artifical array size.

Fixes #43214.
Updates #41621.

Change-Id: Ic047c8aef4f8a3839f2e7e3594bce652ebd6bd5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/278492
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Trust: Than McIntosh <thanm@google.com>
(cherry picked from commit f4e7a6b905ce60448e506a3f6578d01b60602cdd)
Reviewed-on: https://go-review.googlesource.com/c/go/+/278673
src/cmd/internal/goobj2/objfile.go