Source file src/cmd/internal/objabi/util.go
Documentation: cmd/internal/objabi
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 ) 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 } 26