Debian Codegraph @

libgo/go/cmd/internal/objabi/util.go

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