return x &^ 0x80000000
}
-var zeroes string
-
func Addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) int64 {
s.Reachable = true
i := s.Size
const (
thechar = '5'
- PtrSize = 4
- IntSize = 4
- RegSize = 4
MaxAlign = 8 // max data alignment
FuncAlign = 4 // single-instruction alignment
MINLC = 4
const (
thechar = '7'
- PtrSize = 8
- IntSize = 8
- RegSize = 8
MaxAlign = 32 // max data alignment
FuncAlign = 8
MINLC = 4
const (
SARMAG = 8
- SARNAME = 16
SAR_HDR = 16 + 44
)
const (
- ARMAG = "!<arch>\n"
- ARFMAG = "`\n"
+ ARMAG = "!<arch>\n"
)
type ArHdr struct {
// use in debuggers and such.
const (
- MAXIO = 8192
MINFUNC = 16 // minimum size for a function
)
f *os.File
}
-const (
- // Whether to assume that the external linker is "gold"
- // (http://sourceware.org/ml/binutils/2008-03/msg00162.html).
- AssumeGoldLinker = 0
-)
-
const (
symname = "__.GOSYMDEF"
pkgname = "__.PKGDEF"
}
}
- if Iself && AssumeGoldLinker != 0 /*TypeKind(100016)*/ {
- argv = append(argv, "-Wl,--rosegment")
- }
-
switch Buildmode {
case BuildmodeExe:
if HEADTYPE == obj.Hdarwin {
return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
}
-func Be64(b []byte) uint64 {
- return uint64(Be32(b))<<32 | uint64(Be32(b[4:]))
-}
-
type Chain struct {
sym *LSym
up *Chain
}
}
-func Yconv(s *LSym) string {
- var fp string
-
- if s == nil {
- fp += fmt.Sprintf("<nil>")
- } else {
- fmt_ := ""
- fmt_ += fmt.Sprintf("%s @0x%08x [%d]", s.Name, int64(s.Value), int64(s.Size))
- for i := 0; int64(i) < s.Size; i++ {
- if i%8 == 0 {
- fmt_ += fmt.Sprintf("\n\t0x%04x ", i)
- }
- fmt_ += fmt.Sprintf("%02x ", s.P[i])
- }
-
- fmt_ += fmt.Sprintf("\n")
- for i := 0; i < len(s.R); i++ {
- fmt_ += fmt.Sprintf("\t0x%04x[%x] %d %s[%x]\n", s.R[i].Off, s.R[i].Siz, s.R[i].Type, s.R[i].Sym.Name, int64(s.R[i].Add))
- }
-
- str := fmt_
- fp += str
- }
-
- return fp
-}
-
func Cflush() {
if err := coutbuf.Writer.Flush(); err != nil {
Exitf("flushing %s: %v", coutbuf.f.Name(), err)
RV_TYPE_MASK = RV_CHECK_OVERFLOW - 1
)
-const (
- LINKHASH = 100003
-)
-
// Pcdata iterator.
// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
"strconv"
)
-func yy_isalpha(c int) bool {
- return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
-}
-
var headers = []struct {
name string
val int
+++ /dev/null
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ld
-
-// This file defines flags attached to various functions
-// and data objects. The compilers, assemblers, and linker must
-// all agree on these values.
-
-const (
- // Don't profile the marked routine.
- //
- // Deprecated: Not implemented, do not use.
- NOPROF = 1
- // It is ok for the linker to get multiple of these symbols. It will
- // pick one of the duplicates to use.
- DUPOK = 2
- // Don't insert stack check preamble.
- NOSPLIT = 4
- // Put this data in a read-only section.
- RODATA = 8
- // This data contains no pointers.
- NOPTR = 16
- // This is a wrapper function and should not count as disabling 'recover'.
- WRAPPER = 32
- // This function uses its incoming context register.
- NEEDCTXT = 64
-)
return f
}
-func cutStringAtNUL(s string) string {
- if i := strings.Index(s, "\x00"); i >= 0 {
- s = s[:i]
- }
- return s
-}
-
-func Access(name string, mode int) int {
- if mode != 0 {
- panic("bad access")
- }
- _, err := os.Stat(name)
- if err != nil {
- return -1
- }
- return 0
-}
-
// strings.Compare, introduced in Go 1.5.
func stringsCompare(a, b string) int {
if a == b {
const (
thechar = '9'
- PtrSize = 8
- IntSize = 8
- RegSize = 8
MaxAlign = 32 // max data alignment
FuncAlign = 8
MINLC = 4
const (
thechar = '8'
PtrSize = 4
- IntSize = 4
- RegSize = 4
MaxAlign = 32 // max data alignment
FuncAlign = 16
MINLC = 1