Black Lives Matter. Support the Equal Justice Initiative.

Source file src/cmd/link/internal/ld/outbuf_nommap.go

Documentation: cmd/link/internal/ld

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !windows
     6  // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!windows
     7  
     8  package ld
     9  
    10  // Mmap allocates an in-heap output buffer with the given size. It copies
    11  // any old data (if any) to the new buffer.
    12  func (out *OutBuf) Mmap(filesize uint64) error {
    13  	// We need space to put all the symbols before we apply relocations.
    14  	oldheap := out.heap
    15  	if filesize < uint64(len(oldheap)) {
    16  		panic("mmap size too small")
    17  	}
    18  	out.heap = make([]byte, filesize)
    19  	copy(out.heap, oldheap)
    20  	return nil
    21  }
    22  
    23  func (out *OutBuf) munmap() { panic("unreachable") }
    24  

View as plain text