For #59670
Change-Id: If2b05b1ba30b607b518577b0e11ba5a0b07999c5
GitHub-Last-Rev:
a664aa18b5ef674dc2d05c1f7533e1974d265894
GitHub-Pull-Request: golang/go#64906
Reviewed-on: https://go-review.googlesource.com/c/go/+/553276
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
"debug/elf"
"encoding/binary"
"fmt"
+ "internal/abi"
"log"
"os"
"sort"
sect.Align = align
}
- funcsize := uint64(MINFUNC) // spacing required for findfunctab
- if ldr.SymSize(s) > MINFUNC {
+ funcsize := uint64(abi.MINFUNC) // spacing required for findfunctab
+ if ldr.SymSize(s) > abi.MINFUNC {
funcsize = uint64(ldr.SymSize(s))
}
// Assign its address directly in order to be the
// first symbol of this new section.
ntext.SetType(sym.STEXT)
- ntext.SetSize(int64(MINFUNC))
+ ntext.SetSize(int64(abi.MINFUNC))
ntext.SetOnList(true)
ntext.SetAlign(sectAlign)
ctxt.tramps = append(ctxt.tramps, ntext.Sym())
symSize int32
)
-const (
- MINFUNC = 16 // minimum size for a function
-)
-
// Symbol version of ABIInternal symbols. It is sym.SymVerABIInternal if ABI wrappers
// are used, 0 otherwise.
var abiInternalVer = sym.SymVerABIInternal
}
const (
- BUCKETSIZE = 256 * MINFUNC
+ BUCKETSIZE = 256 * abi.MINFUNC
SUBBUCKETS = 16
SUBBUCKETSIZE = BUCKETSIZE / SUBBUCKETS
NOIDX = 0x7fffffff
"cmd/link/internal/sym"
"encoding/binary"
"fmt"
+ "internal/abi"
"internal/buildcfg"
"io"
"regexp"
// However, there is no PC register, only PC_F and PC_B. PC_F denotes the function,
// PC_B the resume point inside of that function. The entry of the function has PC_B = 0.
ldr.SetSymSect(s, sect)
- ldr.SetSymValue(s, int64(funcValueOffset+va/ld.MINFUNC)<<16) // va starts at zero
- va += uint64(ld.MINFUNC)
+ ldr.SetSymValue(s, int64(funcValueOffset+va/abi.MINFUNC)<<16) // va starts at zero
+ va += uint64(abi.MINFUNC)
return sect, n, va
}
// Like UnsafePointRestart1, but back to function entry if async preempted.
UnsafePointRestartAtEntry = -5
)
+
+const MINFUNC = 16 // minimum size for a function
baseaddr uintptr // relocated section address
}
-const minfunc = 16 // minimum function size
-const pcbucketsize = 256 * minfunc // size of bucket in the pc->func lookup table
+const pcbucketsize = 256 * abi.MINFUNC // size of bucket in the pc->func lookup table
// findfuncbucket is an array of these structures.
// Each bucket represents 4096 bytes of the text segment.