...
1
2
3
4
5 package sym
6
7 import (
8 "cmd/internal/obj"
9 "internal/buildcfg"
10 )
11
12 const (
13 SymVerABI0 = 0
14 SymVerABIInternal = 1
15 SymVerABICount = 2
16 SymVerStatic = 10
17 )
18
19 func ABIToVersion(abi obj.ABI) int {
20 switch abi {
21 case obj.ABI0:
22 return SymVerABI0
23 case obj.ABIInternal:
24 if !buildcfg.Experiment.RegabiWrappers {
25
26
27 return SymVerABI0
28 }
29 return SymVerABIInternal
30 }
31 return -1
32 }
33
34 func VersionToABI(v int) (obj.ABI, bool) {
35 switch v {
36 case SymVerABI0:
37 return obj.ABI0, true
38 case SymVerABIInternal:
39 return obj.ABIInternal, true
40 }
41 return ^obj.ABI(0), false
42 }
43
View as plain text