Source file src/cmd/internal/objabi/util.go

     1  // Copyright 2015 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  package objabi
     6  
     7  import (
     8  	"fmt"
     9  	"strings"
    10  
    11  	"internal/buildcfg"
    12  )
    13  
    14  const (
    15  	ElfRelocOffset   = 256
    16  	MachoRelocOffset = 2048    // reserve enough space for ELF relocations
    17  	GlobalDictPrefix = ".dict" // prefix for names of global dictionaries
    18  )
    19  
    20  // HeaderString returns the toolchain configuration string written in
    21  // Go object headers. This string ensures we don't attempt to import
    22  // or link object files that are incompatible with each other. This
    23  // string always starts with "go object ".
    24  func HeaderString() string {
    25  	return fmt.Sprintf("go object %s %s %s X:%s\n", buildcfg.GOOS, buildcfg.GOARCH, buildcfg.Version, strings.Join(buildcfg.EnabledExperiments(), ","))
    26  }
    27  

View as plain text