Commit f4e7a6b
committed
cmd/internal/goobj: fix buglet in object file reader
The code in the new (introduced in 1.15) Go object file reader was
casting a pointer-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 #41621.
Change-Id: Ic047c8aef4f8a3839f2e7e3594bce652ebd6bd5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/278492
Run-TryBot: Than McIntosh <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Cherry Zhang <[email protected]>
Reviewed-by: Jeremy Faller <[email protected]>
Trust: Than McIntosh <[email protected]>1 parent 75e16f5 commit f4e7a6b
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
486 | 491 | | |
487 | 492 | | |
488 | 493 | | |
| |||
792 | 797 | | |
793 | 798 | | |
794 | 799 | | |
795 | | - | |
| 800 | + | |
796 | 801 | | |
797 | 802 | | |
798 | 803 | | |
| |||
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
821 | | - | |
| 826 | + | |
822 | 827 | | |
823 | 828 | | |
824 | 829 | | |
| |||
0 commit comments