We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 127454a commit 7b0f430Copy full SHA for 7b0f430
1 file changed
src/cmd/link/internal/ld/pe.go
@@ -1516,10 +1516,11 @@ func Asmbpe(ctxt *Link) {
1516
}
1517
1518
if rsrcsym != 0 {
1519
- // rsrc.P resides in mmap'd memory, which could be munmap'd
1520
- // underneath us before it comes time to actually use it.
1521
- // To avoid any issues we copy the data to the heap to ensure
1522
- // we don't segfault later when trying to access it.
+ // The resource symbol may have been copied to the mmap'd
+ // output buffer. If so, certain conditions can cause that
+ // mmap'd output buffer to be munmap'd before we get a chance
+ // to use it. To avoid any issues we copy the data to the heap
1523
+ // when the resource symbol exists.
1524
rsrc := ctxt.loader.Syms[rsrcsym]
1525
data := make([]byte, len(rsrc.P))
1526
copy(data, rsrc.P)
0 commit comments