mirror of
https://github.com/golang/go.git
synced 2026-02-05 18:35:03 +03:00
Compare commits
10 Commits
dev.unifie
...
dev.boring
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72237f94a4 | ||
|
|
6f12eb26e4 | ||
|
|
40eb21944e | ||
|
|
34a363c12e | ||
|
|
0ced72fe8b | ||
|
|
418403e7ac | ||
|
|
61246509aa | ||
|
|
e1425b300e | ||
|
|
e52cc9d0fd | ||
|
|
2fb6bf8a4a |
2862
CONTRIBUTORS
Normal file
2862
CONTRIBUTORS
Normal file
File diff suppressed because it is too large
Load Diff
24
README.boringcrypto.md
Normal file
24
README.boringcrypto.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# dev.boringcrypto branch
|
||||
|
||||
This branch is no more. `GOEXPERIMENT=boringcrypto` on the standard branch does the job now.
|
||||
|
||||
Previous notice:
|
||||
|
||||
We have been working inside Google on a fork of Go that uses
|
||||
BoringCrypto (the core of [BoringSSL][]) for various crypto
|
||||
primitives, in furtherance of some [work related to FIPS 140-2][sp].
|
||||
We have heard that some external users of Go would be interested in
|
||||
this code as well, so this branch holds the patches to make Go use
|
||||
BoringCrypto.
|
||||
|
||||
[BoringSSL]: https://boringssl.googlesource.com/boringssl/
|
||||
[sp]: https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp3678.pdf
|
||||
|
||||
Unlike typical dev branches, we do not intend any eventual merge of
|
||||
this code into the master branch. Instead we intend to maintain in
|
||||
this branch the latest release plus BoringCrypto patches.
|
||||
|
||||
To be clear, we are not making any statements or representations about
|
||||
the suitability of this code in relation to the FIPS 140-2 standard.
|
||||
Interested users will have to evaluate for themselves whether the code
|
||||
is useful for their own purposes.
|
||||
292
api/go1.19.txt
292
api/go1.19.txt
@@ -1,292 +0,0 @@
|
||||
pkg crypto/x509, func ParseRevocationList([]uint8) (*RevocationList, error) #50674
|
||||
pkg crypto/x509, method (*CertPool) Clone() *CertPool #35044
|
||||
pkg crypto/x509, method (*CertPool) Equal(*CertPool) bool #46057
|
||||
pkg crypto/x509, method (*RevocationList) CheckSignatureFrom(*Certificate) error #50674
|
||||
pkg crypto/x509, type RevocationList struct, AuthorityKeyId []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, Extensions []pkix.Extension #50674
|
||||
pkg crypto/x509, type RevocationList struct, Issuer pkix.Name #50674
|
||||
pkg crypto/x509, type RevocationList struct, Raw []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, RawIssuer []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, RawTBSRevocationList []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, Signature []uint8 #50674
|
||||
pkg debug/elf, const EM_LOONGARCH = 258 #46229
|
||||
pkg debug/elf, const EM_LOONGARCH Machine #46229
|
||||
pkg debug/elf, const R_LARCH_32 = 1 #46229
|
||||
pkg debug/elf, const R_LARCH_32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_64 = 2 #46229
|
||||
pkg debug/elf, const R_LARCH_64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD16 = 48 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD24 = 49 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD24 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD32 = 50 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD64 = 51 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD8 = 47 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD8 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_COPY = 4 #46229
|
||||
pkg debug/elf, const R_LARCH_COPY R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_IRELATIVE = 12 #46229
|
||||
pkg debug/elf, const R_LARCH_IRELATIVE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_JUMP_SLOT = 5 #46229
|
||||
pkg debug/elf, const R_LARCH_JUMP_SLOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_LA = 20 #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_LA R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_PCREL = 21 #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_NONE = 0 #46229
|
||||
pkg debug/elf, const R_LARCH_NONE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_RELATIVE = 3 #46229
|
||||
pkg debug/elf, const R_LARCH_RELATIVE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ADD = 35 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ADD R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_AND = 36 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_AND R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ASSERT = 30 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ASSERT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_IF_ELSE = 37 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_IF_ELSE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_NOT = 31 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_NOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 = 45 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 = 44 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 = 40 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 = 41 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 = 42 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 = 38 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 = 43 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U = 46 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 = 39 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE = 23 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_DUP = 24 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_DUP R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL = 25 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL = 22 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL = 29 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD = 28 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT = 27 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL = 26 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SL = 33 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SR = 34 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SR R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SUB = 32 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SUB R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB16 = 53 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB24 = 54 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB24 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB32 = 55 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB64 = 56 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB8 = 52 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB8 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD32 = 6 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD64 = 7 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL32 = 8 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL64 = 9 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL32 = 10 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL64 = 11 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL64 R_LARCH #46229
|
||||
pkg debug/elf, method (R_LARCH) GoString() string #46229
|
||||
pkg debug/elf, method (R_LARCH) String() string #46229
|
||||
pkg debug/elf, type R_LARCH int #46229
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY = 2 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH = 4 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST = 6 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES = 1 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE = 3 #51868
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH32 = 25138 #46229
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH32 ideal-int #46229
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH64 = 25188 #46229
|
||||
pkg debug/pe, const IMAGE_FILE_MACHINE_LOONGARCH64 ideal-int #46229
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_CODE = 32 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_CODE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA = 64 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_LNK_COMDAT = 4096 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_LNK_COMDAT ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE = 33554432 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE = 536870912 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_READ = 1073741824 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_READ ideal-int #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_WRITE = 2147483648 #51868
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_WRITE ideal-int #51868
|
||||
pkg debug/pe, method (*File) COFFSymbolReadSectionDefAux(int) (*COFFSymbolAuxFormat5, error) #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Checksum uint32 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumLineNumbers uint16 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumRelocs uint16 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, SecNum uint16 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Selection uint8 #51868
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Size uint32 #51868
|
||||
pkg encoding/binary, func AppendUvarint([]uint8, uint64) []uint8 #51644
|
||||
pkg encoding/binary, func AppendVarint([]uint8, int64) []uint8 #51644
|
||||
pkg encoding/binary, type AppendByteOrder interface { AppendUint16, AppendUint32, AppendUint64, String } #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint16([]uint8, uint16) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint32([]uint8, uint32) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint64([]uint8, uint64) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, String() string #50601
|
||||
pkg encoding/csv, method (*Reader) InputOffset() int64 #43401
|
||||
pkg encoding/xml, method (*Decoder) InputPos() (int, int) #45628
|
||||
pkg flag, func TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
|
||||
pkg flag, method (*FlagSet) TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
|
||||
pkg fmt, func Append([]uint8, ...interface{}) []uint8 #47579
|
||||
pkg fmt, func Appendf([]uint8, string, ...interface{}) []uint8 #47579
|
||||
pkg fmt, func Appendln([]uint8, ...interface{}) []uint8 #47579
|
||||
pkg go/doc, method (*Package) HTML(string) []uint8 #51082
|
||||
pkg go/doc, method (*Package) Markdown(string) []uint8 #51082
|
||||
pkg go/doc, method (*Package) Parser() *comment.Parser #51082
|
||||
pkg go/doc, method (*Package) Printer() *comment.Printer #51082
|
||||
pkg go/doc, method (*Package) Synopsis(string) string #51082
|
||||
pkg go/doc, method (*Package) Text(string) []uint8 #51082
|
||||
pkg go/doc/comment, func DefaultLookupPackage(string) (string, bool) #51082
|
||||
pkg go/doc/comment, method (*DocLink) DefaultURL(string) string #51082
|
||||
pkg go/doc/comment, method (*Heading) DefaultID() string #51082
|
||||
pkg go/doc/comment, method (*List) BlankBefore() bool #51082
|
||||
pkg go/doc/comment, method (*List) BlankBetween() bool #51082
|
||||
pkg go/doc/comment, method (*Parser) Parse(string) *Doc #51082
|
||||
pkg go/doc/comment, method (*Printer) Comment(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) HTML(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) Markdown(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) Text(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, type Block interface, unexported methods #51082
|
||||
pkg go/doc/comment, type Code struct #51082
|
||||
pkg go/doc/comment, type Code struct, Text string #51082
|
||||
pkg go/doc/comment, type Doc struct #51082
|
||||
pkg go/doc/comment, type Doc struct, Content []Block #51082
|
||||
pkg go/doc/comment, type Doc struct, Links []*LinkDef #51082
|
||||
pkg go/doc/comment, type DocLink struct #51082
|
||||
pkg go/doc/comment, type DocLink struct, ImportPath string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Name string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Recv string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Heading struct #51082
|
||||
pkg go/doc/comment, type Heading struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Italic string #51082
|
||||
pkg go/doc/comment, type Link struct #51082
|
||||
pkg go/doc/comment, type Link struct, Auto bool #51082
|
||||
pkg go/doc/comment, type Link struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Link struct, URL string #51082
|
||||
pkg go/doc/comment, type LinkDef struct #51082
|
||||
pkg go/doc/comment, type LinkDef struct, Text string #51082
|
||||
pkg go/doc/comment, type LinkDef struct, URL string #51082
|
||||
pkg go/doc/comment, type LinkDef struct, Used bool #51082
|
||||
pkg go/doc/comment, type List struct #51082
|
||||
pkg go/doc/comment, type List struct, ForceBlankBefore bool #51082
|
||||
pkg go/doc/comment, type List struct, ForceBlankBetween bool #51082
|
||||
pkg go/doc/comment, type List struct, Items []*ListItem #51082
|
||||
pkg go/doc/comment, type ListItem struct #51082
|
||||
pkg go/doc/comment, type ListItem struct, Content []Block #51082
|
||||
pkg go/doc/comment, type ListItem struct, Number string #51082
|
||||
pkg go/doc/comment, type Paragraph struct #51082
|
||||
pkg go/doc/comment, type Paragraph struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Parser struct #51082
|
||||
pkg go/doc/comment, type Parser struct, LookupPackage func(string) (string, bool) #51082
|
||||
pkg go/doc/comment, type Parser struct, LookupSym func(string, string) bool #51082
|
||||
pkg go/doc/comment, type Parser struct, Words map[string]string #51082
|
||||
pkg go/doc/comment, type Plain string #51082
|
||||
pkg go/doc/comment, type Printer struct #51082
|
||||
pkg go/doc/comment, type Printer struct, DocLinkBaseURL string #51082
|
||||
pkg go/doc/comment, type Printer struct, DocLinkURL func(*DocLink) string #51082
|
||||
pkg go/doc/comment, type Printer struct, HeadingID func(*Heading) string #51082
|
||||
pkg go/doc/comment, type Printer struct, HeadingLevel int #51082
|
||||
pkg go/doc/comment, type Printer struct, TextCodePrefix string #51082
|
||||
pkg go/doc/comment, type Printer struct, TextPrefix string #51082
|
||||
pkg go/doc/comment, type Printer struct, TextWidth int #51082
|
||||
pkg go/doc/comment, type Text interface, unexported methods #51082
|
||||
pkg go/types, method (*Func) Origin() *Func #51682
|
||||
pkg go/types, method (*Var) Origin() *Var #51682
|
||||
pkg hash/maphash, func Bytes(Seed, []uint8) uint64 #42710
|
||||
pkg hash/maphash, func String(Seed, string) uint64 #42710
|
||||
pkg html/template, method (*Template) Funcs(template.FuncMap) *Template #46121
|
||||
pkg html/template, type FuncMap = template.FuncMap #46121
|
||||
pkg net/http, method (*MaxBytesError) Error() string #30715
|
||||
pkg net/http, type MaxBytesError struct #30715
|
||||
pkg net/http, type MaxBytesError struct, Limit int64 #30715
|
||||
pkg net/url, func JoinPath(string, ...string) (string, error) #47005
|
||||
pkg net/url, method (*URL) JoinPath(...string) *URL #47005
|
||||
pkg net/url, type URL struct, OmitHost bool #46059
|
||||
pkg os/exec, method (*Cmd) Environ() []string #50599
|
||||
pkg os/exec, type Cmd struct, Err error #43724
|
||||
pkg os/exec, var ErrDot error #43724
|
||||
pkg regexp/syntax, const ErrNestingDepth = "expression nests too deeply" #51684
|
||||
pkg regexp/syntax, const ErrNestingDepth ErrorCode #51684
|
||||
pkg runtime/debug, func SetMemoryLimit(int64) int64 #48409
|
||||
pkg sort, func Find(int, func(int) int) (int, bool) #50340
|
||||
pkg sync/atomic, method (*Bool) CompareAndSwap(bool, bool) bool #50860
|
||||
pkg sync/atomic, method (*Bool) Load() bool #50860
|
||||
pkg sync/atomic, method (*Bool) Store(bool) #50860
|
||||
pkg sync/atomic, method (*Bool) Swap(bool) bool #50860
|
||||
pkg sync/atomic, method (*Int32) Add(int32) int32 #50860
|
||||
pkg sync/atomic, method (*Int32) CompareAndSwap(int32, int32) bool #50860
|
||||
pkg sync/atomic, method (*Int32) Load() int32 #50860
|
||||
pkg sync/atomic, method (*Int32) Store(int32) #50860
|
||||
pkg sync/atomic, method (*Int32) Swap(int32) int32 #50860
|
||||
pkg sync/atomic, method (*Int64) Add(int64) int64 #50860
|
||||
pkg sync/atomic, method (*Int64) CompareAndSwap(int64, int64) bool #50860
|
||||
pkg sync/atomic, method (*Int64) Load() int64 #50860
|
||||
pkg sync/atomic, method (*Int64) Store(int64) #50860
|
||||
pkg sync/atomic, method (*Int64) Swap(int64) int64 #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) CompareAndSwap(*$0, *$0) bool #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) Load() *$0 #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) Store(*$0) #50860
|
||||
pkg sync/atomic, method (*Pointer[$0]) Swap(*$0) *$0 #50860
|
||||
pkg sync/atomic, method (*Uint32) Add(uint32) uint32 #50860
|
||||
pkg sync/atomic, method (*Uint32) CompareAndSwap(uint32, uint32) bool #50860
|
||||
pkg sync/atomic, method (*Uint32) Load() uint32 #50860
|
||||
pkg sync/atomic, method (*Uint32) Store(uint32) #50860
|
||||
pkg sync/atomic, method (*Uint32) Swap(uint32) uint32 #50860
|
||||
pkg sync/atomic, method (*Uint64) Add(uint64) uint64 #50860
|
||||
pkg sync/atomic, method (*Uint64) CompareAndSwap(uint64, uint64) bool #50860
|
||||
pkg sync/atomic, method (*Uint64) Load() uint64 #50860
|
||||
pkg sync/atomic, method (*Uint64) Store(uint64) #50860
|
||||
pkg sync/atomic, method (*Uint64) Swap(uint64) uint64 #50860
|
||||
pkg sync/atomic, method (*Uintptr) Add(uintptr) uintptr #50860
|
||||
pkg sync/atomic, method (*Uintptr) CompareAndSwap(uintptr, uintptr) bool #50860
|
||||
pkg sync/atomic, method (*Uintptr) Load() uintptr #50860
|
||||
pkg sync/atomic, method (*Uintptr) Store(uintptr) #50860
|
||||
pkg sync/atomic, method (*Uintptr) Swap(uintptr) uintptr #50860
|
||||
pkg sync/atomic, type Bool struct #50860
|
||||
pkg sync/atomic, type Int32 struct #50860
|
||||
pkg sync/atomic, type Int64 struct #50860
|
||||
pkg sync/atomic, type Pointer[$0 interface{}] struct #50860
|
||||
pkg sync/atomic, type Uint32 struct #50860
|
||||
pkg sync/atomic, type Uint64 struct #50860
|
||||
pkg sync/atomic, type Uintptr struct #50860
|
||||
pkg time, method (Duration) Abs() Duration #51414
|
||||
pkg time, method (Time) ZoneBounds() (Time, Time) #50062
|
||||
3
api/next/30715.txt
Normal file
3
api/next/30715.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
pkg net/http, type MaxBytesError struct #30715
|
||||
pkg net/http, type MaxBytesError struct, Limit int64 #30715
|
||||
pkg net/http, method (*MaxBytesError) Error() string #30715
|
||||
1
api/next/35044.txt
Normal file
1
api/next/35044.txt
Normal file
@@ -0,0 +1 @@
|
||||
pkg crypto/x509, method (*CertPool) Clone() *CertPool #35044
|
||||
2
api/next/42710.txt
Normal file
2
api/next/42710.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg hash/maphash, func Bytes(Seed, []uint8) uint64 #42710
|
||||
pkg hash/maphash, func String(Seed, string) uint64 #42710
|
||||
1
api/next/45628.txt
Normal file
1
api/next/45628.txt
Normal file
@@ -0,0 +1 @@
|
||||
pkg encoding/xml, method (*Decoder) InputPos() (int, int) #45628
|
||||
2
api/next/45754.txt
Normal file
2
api/next/45754.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg flag, func TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
|
||||
pkg flag, method (*FlagSet) TextVar(encoding.TextUnmarshaler, string, encoding.TextMarshaler, string) #45754
|
||||
1
api/next/46057.txt
Normal file
1
api/next/46057.txt
Normal file
@@ -0,0 +1 @@
|
||||
pkg crypto/x509, method (*CertPool) Equal(*CertPool) bool #46057
|
||||
2
api/next/46059.txt
Normal file
2
api/next/46059.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg net/url, type URL struct, OmitHost bool #46059
|
||||
|
||||
2
api/next/46121.txt
Normal file
2
api/next/46121.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg html/template, method (*Template) Funcs(template.FuncMap) *Template #46121
|
||||
pkg html/template, type FuncMap = template.FuncMap #46121
|
||||
105
api/next/46229.txt
Normal file
105
api/next/46229.txt
Normal file
@@ -0,0 +1,105 @@
|
||||
pkg debug/elf, const EM_LOONGARCH = 258 #46229
|
||||
pkg debug/elf, const EM_LOONGARCH Machine #46229
|
||||
pkg debug/elf, const R_LARCH_32 = 1 #46229
|
||||
pkg debug/elf, const R_LARCH_32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_64 = 2 #46229
|
||||
pkg debug/elf, const R_LARCH_64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD16 = 48 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD24 = 49 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD24 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD32 = 50 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD64 = 51 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_ADD8 = 47 #46229
|
||||
pkg debug/elf, const R_LARCH_ADD8 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_COPY = 4 #46229
|
||||
pkg debug/elf, const R_LARCH_COPY R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_IRELATIVE = 12 #46229
|
||||
pkg debug/elf, const R_LARCH_IRELATIVE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_JUMP_SLOT = 5 #46229
|
||||
pkg debug/elf, const R_LARCH_JUMP_SLOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_LA = 20 #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_LA R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_PCREL = 21 #46229
|
||||
pkg debug/elf, const R_LARCH_MARK_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_NONE = 0 #46229
|
||||
pkg debug/elf, const R_LARCH_NONE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_RELATIVE = 3 #46229
|
||||
pkg debug/elf, const R_LARCH_RELATIVE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ADD = 35 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ADD R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_AND = 36 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_AND R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ASSERT = 30 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_ASSERT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_IF_ELSE = 37 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_IF_ELSE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_NOT = 31 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_NOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 = 45 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_10_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 = 44 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_0_5_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 = 40 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_12 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 = 41 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 = 42 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_16_S2 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 = 38 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_10_5 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 = 43 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_S_5_20 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U = 46 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 = 39 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_POP_32_U_10_12 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE = 23 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_ABSOLUTE R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_DUP = 24 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_DUP R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL = 25 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_GPREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL = 22 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL = 29 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_PLT_PCREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD = 28 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GD R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT = 27 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_GOT R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL = 26 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_PUSH_TLS_TPREL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SL = 33 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SL R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SR = 34 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SR R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SUB = 32 #46229
|
||||
pkg debug/elf, const R_LARCH_SOP_SUB R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB16 = 53 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB16 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB24 = 54 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB24 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB32 = 55 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB64 = 56 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_SUB8 = 52 #46229
|
||||
pkg debug/elf, const R_LARCH_SUB8 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD32 = 6 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD64 = 7 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPMOD64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL32 = 8 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL64 = 9 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_DTPREL64 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL32 = 10 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL32 R_LARCH #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL64 = 11 #46229
|
||||
pkg debug/elf, const R_LARCH_TLS_TPREL64 R_LARCH #46229
|
||||
pkg debug/elf, method (R_LARCH) GoString() string #46229
|
||||
pkg debug/elf, method (R_LARCH) String() string #46229
|
||||
pkg debug/elf, type R_LARCH int #46229
|
||||
2
api/next/47005.txt
Normal file
2
api/next/47005.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg net/url, func JoinPath(string, ...string) (string, error) #47005
|
||||
pkg net/url, method (*URL) JoinPath(...string) *URL #47005
|
||||
1
api/next/50340.txt
Normal file
1
api/next/50340.txt
Normal file
@@ -0,0 +1 @@
|
||||
pkg sort, func Find(int, func(int) int) (int, bool) #50340
|
||||
1
api/next/50599.txt
Normal file
1
api/next/50599.txt
Normal file
@@ -0,0 +1 @@
|
||||
pkg os/exec, method (*Cmd) Environ() []string #50599
|
||||
5
api/next/50601.txt
Normal file
5
api/next/50601.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
pkg encoding/binary, type AppendByteOrder interface { AppendUint16, AppendUint32, AppendUint64, String } #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint16([]uint8, uint16) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint32([]uint8, uint32) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, AppendUint64([]uint8, uint64) []uint8 #50601
|
||||
pkg encoding/binary, type AppendByteOrder interface, String() string #50601
|
||||
9
api/next/50674.txt
Normal file
9
api/next/50674.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
pkg crypto/x509, func ParseRevocationList([]uint8) (*RevocationList, error) #50674
|
||||
pkg crypto/x509, method (*RevocationList) CheckSignatureFrom(*Certificate) error #50674
|
||||
pkg crypto/x509, type RevocationList struct, AuthorityKeyId []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, Extensions []pkix.Extension #50674
|
||||
pkg crypto/x509, type RevocationList struct, Issuer pkix.Name #50674
|
||||
pkg crypto/x509, type RevocationList struct, Raw []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, RawIssuer []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, RawTBSRevocationList []uint8 #50674
|
||||
pkg crypto/x509, type RevocationList struct, Signature []uint8 #50674
|
||||
61
api/next/51082.txt
Normal file
61
api/next/51082.txt
Normal file
@@ -0,0 +1,61 @@
|
||||
pkg go/doc, method (*Package) HTML(string) []uint8 #51082
|
||||
pkg go/doc, method (*Package) Markdown(string) []uint8 #51082
|
||||
pkg go/doc, method (*Package) Parser() *comment.Parser #51082
|
||||
pkg go/doc, method (*Package) Printer() *comment.Printer #51082
|
||||
pkg go/doc, method (*Package) Synopsis(string) string #51082
|
||||
pkg go/doc, method (*Package) Text(string) []uint8 #51082
|
||||
pkg go/doc/comment, func DefaultLookupPackage(string) (string, bool) #51082
|
||||
pkg go/doc/comment, method (*DocLink) DefaultURL(string) string #51082
|
||||
pkg go/doc/comment, method (*Heading) DefaultID() string #51082
|
||||
pkg go/doc/comment, method (*List) BlankBefore() bool #51082
|
||||
pkg go/doc/comment, method (*List) BlankBetween() bool #51082
|
||||
pkg go/doc/comment, method (*Parser) Parse(string) *Doc #51082
|
||||
pkg go/doc/comment, method (*Printer) Comment(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) HTML(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) Markdown(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, method (*Printer) Text(*Doc) []uint8 #51082
|
||||
pkg go/doc/comment, type Block interface, unexported methods #51082
|
||||
pkg go/doc/comment, type Code struct #51082
|
||||
pkg go/doc/comment, type Code struct, Text string #51082
|
||||
pkg go/doc/comment, type Doc struct #51082
|
||||
pkg go/doc/comment, type Doc struct, Content []Block #51082
|
||||
pkg go/doc/comment, type Doc struct, Links []*LinkDef #51082
|
||||
pkg go/doc/comment, type DocLink struct #51082
|
||||
pkg go/doc/comment, type DocLink struct, ImportPath string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Name string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Recv string #51082
|
||||
pkg go/doc/comment, type DocLink struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Heading struct #51082
|
||||
pkg go/doc/comment, type Heading struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Italic string #51082
|
||||
pkg go/doc/comment, type Link struct #51082
|
||||
pkg go/doc/comment, type Link struct, Auto bool #51082
|
||||
pkg go/doc/comment, type Link struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Link struct, URL string #51082
|
||||
pkg go/doc/comment, type LinkDef struct #51082
|
||||
pkg go/doc/comment, type LinkDef struct, Text string #51082
|
||||
pkg go/doc/comment, type LinkDef struct, URL string #51082
|
||||
pkg go/doc/comment, type LinkDef struct, Used bool #51082
|
||||
pkg go/doc/comment, type List struct #51082
|
||||
pkg go/doc/comment, type List struct, ForceBlankBefore bool #51082
|
||||
pkg go/doc/comment, type List struct, ForceBlankBetween bool #51082
|
||||
pkg go/doc/comment, type List struct, Items []*ListItem #51082
|
||||
pkg go/doc/comment, type ListItem struct #51082
|
||||
pkg go/doc/comment, type ListItem struct, Content []Block #51082
|
||||
pkg go/doc/comment, type ListItem struct, Number string #51082
|
||||
pkg go/doc/comment, type Paragraph struct #51082
|
||||
pkg go/doc/comment, type Paragraph struct, Text []Text #51082
|
||||
pkg go/doc/comment, type Parser struct #51082
|
||||
pkg go/doc/comment, type Parser struct, LookupPackage func(string) (string, bool) #51082
|
||||
pkg go/doc/comment, type Parser struct, LookupSym func(string, string) bool #51082
|
||||
pkg go/doc/comment, type Parser struct, Words map[string]string #51082
|
||||
pkg go/doc/comment, type Plain string #51082
|
||||
pkg go/doc/comment, type Printer struct #51082
|
||||
pkg go/doc/comment, type Printer struct, DocLinkBaseURL string #51082
|
||||
pkg go/doc/comment, type Printer struct, DocLinkURL func(*DocLink) string #51082
|
||||
pkg go/doc/comment, type Printer struct, HeadingID func(*Heading) string #51082
|
||||
pkg go/doc/comment, type Printer struct, HeadingLevel int #51082
|
||||
pkg go/doc/comment, type Printer struct, TextCodePrefix string #51082
|
||||
pkg go/doc/comment, type Printer struct, TextPrefix string #51082
|
||||
pkg go/doc/comment, type Printer struct, TextWidth int #51082
|
||||
pkg go/doc/comment, type Text interface, unexported methods #51082
|
||||
1
api/next/51414.txt
Normal file
1
api/next/51414.txt
Normal file
@@ -0,0 +1 @@
|
||||
pkg time, method (Duration) Abs() Duration #51414
|
||||
2
api/next/51644.txt
Normal file
2
api/next/51644.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg encoding/binary, func AppendUvarint([]uint8, uint64) []uint8 #51644
|
||||
pkg encoding/binary, func AppendVarint([]uint8, int64) []uint8 #51644
|
||||
2
api/next/51684.txt
Normal file
2
api/next/51684.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pkg regexp/syntax, const ErrNestingDepth = "expression nests too deeply" #51684
|
||||
pkg regexp/syntax, const ErrNestingDepth ErrorCode #51684
|
||||
36
api/next/51868.txt
Normal file
36
api/next/51868.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY = 2 #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ANY ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE = 5 #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_ASSOCIATIVE ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH = 4 #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_EXACT_MATCH ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST = 6 #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_LARGEST ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES = 1 #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_NODUPLICATES ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE = 3 #51686
|
||||
pkg debug/pe, const IMAGE_COMDAT_SELECT_SAME_SIZE ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_CODE = 32 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_CODE ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA = 64 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_INITIALIZED_DATA ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_CNT_UNINITIALIZED_DATA ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_LNK_COMDAT = 4096 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_LNK_COMDAT ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE = 33554432 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_DISCARDABLE ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE = 536870912 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_EXECUTE ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_READ = 1073741824 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_READ ideal-int #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_WRITE = 2147483648 #51686
|
||||
pkg debug/pe, const IMAGE_SCN_MEM_WRITE ideal-int #51686
|
||||
pkg debug/pe, method (*File) COFFSymbolReadSectionDefAux(int) (*COFFSymbolAuxFormat5, error) #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Checksum uint32 #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumLineNumbers uint16 #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, NumRelocs uint16 #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, SecNum uint16 #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Selection uint8 #51686
|
||||
pkg debug/pe, type COFFSymbolAuxFormat5 struct, Size uint32 #51686
|
||||
@@ -1,2 +1,2 @@
|
||||
branch: dev.unified
|
||||
branch: dev.boringcrypto
|
||||
parent-branch: master
|
||||
|
||||
179
doc/go1.19.html
Normal file
179
doc/go1.19.html
Normal file
@@ -0,0 +1,179 @@
|
||||
<!--{
|
||||
"Title": "Go 1.19 Release Notes",
|
||||
"Path": "/doc/go1.19"
|
||||
}-->
|
||||
<!--
|
||||
NOTE: In this document and others in this directory, the convention is to
|
||||
set fixed-width phrases with non-fixed-width spaces, as in
|
||||
<code>hello</code> <code>world</code>.
|
||||
Do not send CLs removing the interior tags from such phrases.
|
||||
-->
|
||||
<style>
|
||||
main ul li { margin: 0.5em 0; }
|
||||
</style>
|
||||
<h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.19</h2>
|
||||
<p>
|
||||
<strong>
|
||||
Go 1.19 is not yet released. These are work-in-progress
|
||||
release notes. Go 1.19 is expected to be released in August 2022.
|
||||
</strong>
|
||||
</p>
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
<p>
|
||||
TODO: complete this section
|
||||
</p>
|
||||
<h2 id="ports">Ports</h2>
|
||||
<p>
|
||||
TODO: complete this section, or delete if not needed
|
||||
</p>
|
||||
<h2 id="tools">Tools</h2>
|
||||
<p>
|
||||
TODO: complete this section, or delete if not needed
|
||||
</p>
|
||||
<h3 id="go-command">Go command</h3>
|
||||
<p>
|
||||
TODO: complete this section.
|
||||
</p>
|
||||
|
||||
<!-- https://go.dev/issue/51461 -->
|
||||
<p>
|
||||
The <code>-trimpath</code> flag, if set, is now included in the build settings
|
||||
stamped into Go binaries by <code>go</code> <code>build</code>, and can be
|
||||
examined using
|
||||
<a href="https://pkg.go.dev/cmd/go#hdr-Print_Go_version"><code>go</code> <code>version</code> <code>-m</code></a>
|
||||
or <a href="https://pkg.go.dev/runtime/debug#ReadBuildInfo"><code>debug.ReadBuildInfo</code></a>.
|
||||
</p>
|
||||
<p>
|
||||
<code>go</code> <code>generate</code> now sets the <code>GOROOT</code>
|
||||
environment variable explicitly in the generator's environment, so that
|
||||
generators can locate the correct <code>GOROOT</code> even if built
|
||||
with <code>-trimpath</code>.
|
||||
</p>
|
||||
|
||||
<h4 id="go-unix">New <code>unix</code> build constraint</h4>
|
||||
|
||||
<p><!-- CL 389934 -->
|
||||
The build constraint <code>unix</code> is now recognized
|
||||
in <code>//go:build</code> lines. The constraint is satisfied
|
||||
if the target operating system, also known as <code>GOOS</code>, is
|
||||
a Unix or Unix-like system. For the 1.19 release it is satisfied
|
||||
if <code>GOOS</code> is one of
|
||||
<code>aix</code>, <code>android</code>, <code>darwin</code>,
|
||||
<code>dragonfly</code>, <code>freebsd</code>, <code>hurd</code>,
|
||||
<code>illumos</code>, <code>ios</code>, <code>linux</code>,
|
||||
<code>netbsd</code>, <code>openbsd</code>, or <code>solaris</code>.
|
||||
In future releases the <code>unix</code> constraint may match
|
||||
additional newly supported operating systems.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
<p>
|
||||
TODO: complete this section, or delete if not needed
|
||||
</p>
|
||||
<h2 id="compiler">Compiler</h2>
|
||||
<p>
|
||||
TODO: complete this section, or delete if not needed
|
||||
</p>
|
||||
<h2 id="linker">Linker</h2>
|
||||
<p>
|
||||
TODO: complete this section, or delete if not needed
|
||||
</p>
|
||||
<h2 id="library">Core library</h2>
|
||||
<p>
|
||||
TODO: complete this section
|
||||
</p>
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
<p>
|
||||
TODO: complete this section
|
||||
</p>
|
||||
|
||||
<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 400974 -->
|
||||
The <code>tls10default</code> <code>GODEBUG</code> option has been
|
||||
removed. It is still possible to enable TLS 1.0 client-side by setting
|
||||
<code>Config.MinVersion</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- crypto/tls -->
|
||||
|
||||
<dl id="image/draw"><dt><a href="/pkg/image/draw/">image/draw</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 396795 -->
|
||||
<code>Draw</code> with the <code>Src</code> operator preserves
|
||||
non-premultiplied-alpha colors when destination and source images are
|
||||
both <code>*image.NRGBA</code> (or both <code>*image.NRGBA64</code>).
|
||||
This reverts a behavior change accidentally introduced by a Go 1.18
|
||||
library optimization, to match the behavior in Go 1.17 and earlier.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- image/draw -->
|
||||
|
||||
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 386016 -->
|
||||
The pure Go resolver will now use EDNS(0) to include a suggested
|
||||
maximum reply packet length, permitting reply packets to contain
|
||||
up to 1232 bytes (the previous maximum was 512).
|
||||
In the unlikely event that this causes problems with a local DNS
|
||||
resolver, setting the environment variable
|
||||
<code>GODEBUG=netdns=cgo</code> to use the cgo-based resolver
|
||||
should work.
|
||||
Please report any such problems on <a href="/issue/new">the
|
||||
issue tracker</a>.
|
||||
</p>
|
||||
|
||||
<p><!-- CL 396877 -->
|
||||
When a net package function or method returns an "I/O timeout"
|
||||
error, the error will now satisfy <code>errors.Is(err,
|
||||
context.DeadlineExceeded)</code>. When a net package function
|
||||
returns an "operation was canceled" error, the error will now
|
||||
satisfy <code>errors.Is(err, context.Canceled)</code>.
|
||||
These changes are intended to make it easier for code to test
|
||||
for cases in which a context cancelation or timeout causes a net
|
||||
package function or method to return an error, while preserving
|
||||
backward compatibility for error messages.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- net -->
|
||||
|
||||
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
|
||||
<dd><!-- https://go.dev/issue/50599 -->
|
||||
<p>
|
||||
An <code>exec.Cmd</code> with a non-empty <code>Dir</code> and a
|
||||
nil <code>Env</code> now implicitly sets the <code>PWD</code> environment
|
||||
variable for the subprocess to match <code>Dir</code>.
|
||||
</p>
|
||||
<p>
|
||||
The new method <code>(*exec.Cmd).Environ</code> reports the
|
||||
environment that would be used to run the command, including the
|
||||
aforementioned <code>PWD</code> variable.
|
||||
</p>
|
||||
</dd>
|
||||
</dl> <!-- os/exec -->
|
||||
|
||||
<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/51461 -->
|
||||
The <code>GOROOT</code> function now returns the empty string
|
||||
(instead of <code>"go"</code>) when the binary was built with
|
||||
the <code>-trimpath</code> flag set and the <code>GOROOT</code>
|
||||
variable is not set in the process environment.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- runtime -->
|
||||
|
||||
<dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 397255 -->
|
||||
<a href="/pkg/strconv/#strconv.Quote"><code>strconv.Quote</code></a>
|
||||
and related functions now quote the rune 007F as <code>\x7f</code>,
|
||||
not <code>\u007f</code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- strconv -->
|
||||
589
doc/go_mem.html
589
doc/go_mem.html
@@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Memory Model",
|
||||
"Subtitle": "Version of June 6, 2022",
|
||||
"Subtitle": "Version of May 31, 2014",
|
||||
"Path": "/ref/mem"
|
||||
}-->
|
||||
|
||||
@@ -8,9 +8,12 @@
|
||||
p.rule {
|
||||
font-style: italic;
|
||||
}
|
||||
span.event {
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h2 id="introduction">Introduction</h2>
|
||||
<h2>Introduction</h2>
|
||||
|
||||
<p>
|
||||
The Go memory model specifies the conditions under which
|
||||
@@ -19,7 +22,7 @@ observe values produced by writes to the same variable in a different goroutine.
|
||||
</p>
|
||||
|
||||
|
||||
<h3 id="advice">Advice</h3>
|
||||
<h2>Advice</h2>
|
||||
|
||||
<p>
|
||||
Programs that modify data being simultaneously accessed by multiple goroutines
|
||||
@@ -41,237 +44,90 @@ you are being too clever.
|
||||
Don't be clever.
|
||||
</p>
|
||||
|
||||
<h3 id="overview">Informal Overview</h3>
|
||||
<h2>Happens Before</h2>
|
||||
|
||||
<p>
|
||||
Go approaches its memory model in much the same way as the rest of the language,
|
||||
aiming to keep the semantics simple, understandable, and useful.
|
||||
This section gives a general overview of the approach and should suffice for most programmers.
|
||||
The memory model is specified more formally in the next section.
|
||||
Within a single goroutine, reads and writes must behave
|
||||
as if they executed in the order specified by the program.
|
||||
That is, compilers and processors may reorder the reads and writes
|
||||
executed within a single goroutine only when the reordering
|
||||
does not change the behavior within that goroutine
|
||||
as defined by the language specification.
|
||||
Because of this reordering, the execution order observed
|
||||
by one goroutine may differ from the order perceived
|
||||
by another. For example, if one goroutine
|
||||
executes <code>a = 1; b = 2;</code>, another might observe
|
||||
the updated value of <code>b</code> before the updated value of <code>a</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <em>data race</em> is defined as
|
||||
a write to a memory location happening concurrently with another read or write to that same location,
|
||||
unless all the accesses involved are atomic data accesses as provided by the <code>sync/atomic</code> package.
|
||||
As noted already, programmers are strongly encouraged to use appropriate synchronization
|
||||
to avoid data races.
|
||||
In the absence of data races, Go programs behave as if all the goroutines
|
||||
were multiplexed onto a single processor.
|
||||
This property is sometimes referred to as DRF-SC: data-race-free programs
|
||||
execute in a sequentially consistent manner.
|
||||
To specify the requirements of reads and writes, we define
|
||||
<i>happens before</i>, a partial order on the execution
|
||||
of memory operations in a Go program. If event <span class="event">e<sub>1</sub></span> happens
|
||||
before event <span class="event">e<sub>2</sub></span>, then we say that <span class="event">e<sub>2</sub></span> happens after <span class="event">e<sub>1</sub></span>.
|
||||
Also, if <span class="event">e<sub>1</sub></span> does not happen before <span class="event">e<sub>2</sub></span> and does not happen
|
||||
after <span class="event">e<sub>2</sub></span>, then we say that <span class="event">e<sub>1</sub></span> and <span class="event">e<sub>2</sub></span> happen concurrently.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
Within a single goroutine, the happens-before order is the
|
||||
order expressed by the program.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
While programmers should write Go programs without data races,
|
||||
there are limitations to what a Go implementation can do in response to a data race.
|
||||
An implementation may always react to a data race by reporting the race and terminating the program.
|
||||
Otherwise, each read of a single-word-sized or sub-word-sized memory location
|
||||
must observe a value actually written to that location (perhaps by a concurrent executing goroutine)
|
||||
and not yet overwritten.
|
||||
These implementation constraints make Go more like Java or JavaScript,
|
||||
in that most races have a limited number of outcomes,
|
||||
and less like C and C++, where the meaning of any program with a race
|
||||
is entirely undefined, and the compiler may do anything at all.
|
||||
Go's approach aims to make errant programs more reliable and easier to debug,
|
||||
while still insisting that races are errors and that tools can diagnose and report them.
|
||||
A read <span class="event">r</span> of a variable <code>v</code> is <i>allowed</i> to observe a write <span class="event">w</span> to <code>v</code>
|
||||
if both of the following hold:
|
||||
</p>
|
||||
|
||||
<h2 id="model">Memory Model</h2>
|
||||
|
||||
<p>
|
||||
The following formal definition of Go's memory model closely follows
|
||||
the approach presented by Hans-J. Boehm and Sarita V. Adve in
|
||||
“<a href="https://www.hpl.hp.com/techreports/2008/HPL-2008-56.pdf">Foundations of the C++ Concurrency Memory Model</a>”,
|
||||
published in PLDI 2008.
|
||||
The definition of data-race-free programs and the guarantee of sequential consistency
|
||||
for race-free programs are equivalent to the ones in that work.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The memory model describes the requirements on program executions,
|
||||
which are made up of goroutine executions,
|
||||
which in turn are made up of memory operations.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <i>memory operation</i> is modeled by four details:
|
||||
</p>
|
||||
<ul>
|
||||
<li>its kind, indicating whether it is an ordinary data read, an ordinary data write,
|
||||
or a <i>synchronizing operation</i> such as an atomic data access,
|
||||
a mutex operation, or a channel operation,
|
||||
<li>its location in the program,
|
||||
<li>the memory location or variable being accessed, and
|
||||
<li>the values read or written by the operation.
|
||||
</ul>
|
||||
<p>
|
||||
Some memory operations are <i>read-like</i>, including read, atomic read, mutex lock, and channel receive.
|
||||
Other memory operations are <i>write-like</i>, including write, atomic write, mutex unlock, channel send, and channel close.
|
||||
Some, such as atomic compare-and-swap, are both read-like and write-like.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <i>goroutine execution</i> is modeled as a set of memory operations executed by a single goroutine.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Requirement 1</b>:
|
||||
The memory operations in each goroutine must correspond to a correct sequential execution of that goroutine,
|
||||
given the values read from and written to memory.
|
||||
That execution must be consistent with the <i>sequenced before</i> relation,
|
||||
defined as the partial order requirements set out by the <a href="/ref/spec">Go language specification</a>
|
||||
for Go's control flow constructs as well as the <a href="/ref/spec#Order_of_evaluation">order of evaluation for expressions</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A Go <i>program execution</i> is modeled as a set of goroutine executions,
|
||||
together with a mapping <i>W</i> that specifies the write-like operation that each read-like operation reads from.
|
||||
(Multiple executions of the same program can have different program executions.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Requirement 2</b>:
|
||||
For a given program execution, the mapping <i>W</i>, when limited to synchronizing operations,
|
||||
must be explainable by some implicit total order of the synchronizing operations
|
||||
that is consistent with sequencing and the values read and written by those operations.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <i>synchronized before</i> relation is a partial order on synchronizing memory operations,
|
||||
derived from <i>W</i>.
|
||||
If a synchronizing read-like memory operation <i>r</i>
|
||||
observes a synchronizing write-like memory operation <i>w</i>
|
||||
(that is, if <i>W</i>(<i>r</i>) = <i>w</i>),
|
||||
then <i>w</i> is synchronized before <i>r</i>.
|
||||
Informally, the synchronized before relation is a subset of the implied total order
|
||||
mentioned in the previous paragraph,
|
||||
limited to the information that <i>W</i> directly observes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <i>happens before</i> relation is defined as the transitive closure of the
|
||||
union of the sequenced before and synchronized before relations.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Requirement 3</b>:
|
||||
For an ordinary (non-synchronizing) data read <i>r</i> on a memory location <i>x</i>,
|
||||
<i>W</i>(<i>r</i>) must be a write <i>w</i> that is <i>visible</i> to <i>r</i>,
|
||||
where visible means that both of the following hold:
|
||||
|
||||
<ol>
|
||||
<li><i>w</i> happens before <i>r</i>.
|
||||
<li><i>w</i> does not happen before any other write <i>w'</i> (to <i>x</i>) that happens before <i>r</i>.
|
||||
<li><span class="event">r</span> does not happen before <span class="event">w</span>.</li>
|
||||
<li>There is no other write <span class="event">w'</span> to <code>v</code> that happens
|
||||
after <span class="event">w</span> but before <span class="event">r</span>.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
A <i>read-write data race</i> on memory location <i>x</i>
|
||||
consists of a read-like memory operation <i>r</i> on <i>x</i>
|
||||
and a write-like memory operation <i>w</i> on <i>x</i>,
|
||||
at least one of which is non-synchronizing,
|
||||
which are unordered by happens before
|
||||
(that is, neither <i>r</i> happens before <i>w</i>
|
||||
nor <i>w</i> happens before <i>r</i>).
|
||||
To guarantee that a read <span class="event">r</span> of a variable <code>v</code> observes a
|
||||
particular write <span class="event">w</span> to <code>v</code>, ensure that <span class="event">w</span> is the only
|
||||
write <span class="event">r</span> is allowed to observe.
|
||||
That is, <span class="event">r</span> is <i>guaranteed</i> to observe <span class="event">w</span> if both of the following hold:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li><span class="event">w</span> happens before <span class="event">r</span>.</li>
|
||||
<li>Any other write to the shared variable <code>v</code>
|
||||
either happens before <span class="event">w</span> or after <span class="event">r</span>.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
This pair of conditions is stronger than the first pair;
|
||||
it requires that there are no other writes happening
|
||||
concurrently with <span class="event">w</span> or <span class="event">r</span>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A <i>write-write data race</i> on memory location <i>x</i>
|
||||
consists of two write-like memory operations <i>w</i> and <i>w'</i> on <i>x</i>,
|
||||
at least one of which is non-synchronizing,
|
||||
which are unordered by happens before.
|
||||
Within a single goroutine,
|
||||
there is no concurrency, so the two definitions are equivalent:
|
||||
a read <span class="event">r</span> observes the value written by the most recent write <span class="event">w</span> to <code>v</code>.
|
||||
When multiple goroutines access a shared variable <code>v</code>,
|
||||
they must use synchronization events to establish
|
||||
happens-before conditions that ensure reads observe the
|
||||
desired writes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that if there are no read-write or write-write data races on memory location <i>x</i>,
|
||||
then any read <i>r</i> on <i>x</i> has only one possible <i>W</i>(<i>r</i>):
|
||||
the single <i>w</i> that immediately precedes it in the happens before order.
|
||||
The initialization of variable <code>v</code> with the zero value
|
||||
for <code>v</code>'s type behaves as a write in the memory model.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
More generally, it can be shown that any Go program that is data-race-free,
|
||||
meaning it has no program executions with read-write or write-write data races,
|
||||
can only have outcomes explained by some sequentially consistent interleaving
|
||||
of the goroutine executions.
|
||||
(The proof is the same as Section 7 of Boehm and Adve's paper cited above.)
|
||||
This property is called DRF-SC.
|
||||
Reads and writes of values larger than a single machine word
|
||||
behave as multiple machine-word-sized operations in an
|
||||
unspecified order.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The intent of the formal definition is to match
|
||||
the DRF-SC guarantee provided to race-free programs
|
||||
by other languages, including C, C++, Java, JavaScript, Rust, and Swift.
|
||||
</p>
|
||||
<h2>Synchronization</h2>
|
||||
|
||||
<p>
|
||||
Certain Go language operations such as goroutine creation and memory allocation
|
||||
act as synchronization operations.
|
||||
The effect of these operations on the synchronized-before partial order
|
||||
is documented in the “Synchronization” section below.
|
||||
Individual packages are responsible for providing similar documentation
|
||||
for their own operations.
|
||||
</p>
|
||||
|
||||
<h2 id="restrictions">Implementation Restrictions for Programs Containing Data Races</h2>
|
||||
|
||||
<p>
|
||||
The preceding section gave a formal definition of data-race-free program execution.
|
||||
This section informally describes the semantics that implementations must provide
|
||||
for programs that do contain races.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
First, any implementation can, upon detecting a data race,
|
||||
report the race and halt execution of the program.
|
||||
Implementations using ThreadSanitizer
|
||||
(accessed with “<code>go</code> <code>build</code> <code>-race</code>”)
|
||||
do exactly this.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Otherwise, a read <i>r</i> of a memory location <i>x</i>
|
||||
that is not larger than a machine word must observe
|
||||
some write <i>w</i> such that <i>r</i> does not happen before <i>w</i>
|
||||
and there is no write <i>w'</i> such that <i>w</i> happens before <i>w'</i>
|
||||
and <i>w'</i> happens before <i>r</i>.
|
||||
That is, each read must observe a value written by a preceding or concurrent write.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Additionally, observation of acausal and “out of thin air” writes is disallowed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Reads of memory locations larger than a single machine word
|
||||
are encouraged but not required to meet the same semantics
|
||||
as word-sized memory locations,
|
||||
observing a single allowed write <i>w</i>.
|
||||
For performance reasons,
|
||||
implementations may instead treat larger operations
|
||||
as a set of individual machine-word-sized operations
|
||||
in an unspecified order.
|
||||
This means that races on multiword data structures
|
||||
can lead to inconsistent values not corresponding to a single write.
|
||||
When the values depend on the consistency
|
||||
of internal (pointer, length) or (pointer, type) pairs,
|
||||
as can be the case for interface values, maps,
|
||||
slices, and strings in most Go implementations,
|
||||
such races can in turn lead to arbitrary memory corruption.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Examples of incorrect synchronization are given in the
|
||||
“Incorrect synchronization” section below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Examples of the limitations on implementations are given in the
|
||||
“Incorrect compilation” section below.
|
||||
</p>
|
||||
|
||||
<h2 id="synchronization">Synchronization</h2>
|
||||
|
||||
<h3 id="init">Initialization</h3>
|
||||
<h3>Initialization</h3>
|
||||
|
||||
<p>
|
||||
Program initialization runs in a single goroutine,
|
||||
@@ -285,15 +141,15 @@ If a package <code>p</code> imports package <code>q</code>, the completion of
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The completion of all <code>init</code> functions is synchronized before
|
||||
the start of the function <code>main.main</code>.
|
||||
The start of the function <code>main.main</code> happens after
|
||||
all <code>init</code> functions have finished.
|
||||
</p>
|
||||
|
||||
<h3 id="go">Goroutine creation</h3>
|
||||
<h3>Goroutine creation</h3>
|
||||
|
||||
<p class="rule">
|
||||
The <code>go</code> statement that starts a new goroutine
|
||||
is synchronized before the start of the goroutine's execution.
|
||||
happens before the goroutine's execution begins.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -318,12 +174,11 @@ calling <code>hello</code> will print <code>"hello, world"</code>
|
||||
at some point in the future (perhaps after <code>hello</code> has returned).
|
||||
</p>
|
||||
|
||||
<h3 id="goexit">Goroutine destruction</h3>
|
||||
<h3>Goroutine destruction</h3>
|
||||
|
||||
<p>
|
||||
The exit of a goroutine is not guaranteed to be synchronized before
|
||||
any event in the program.
|
||||
For example, in this program:
|
||||
The exit of a goroutine is not guaranteed to happen before
|
||||
any event in the program. For example, in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -348,7 +203,7 @@ use a synchronization mechanism such as a lock or channel
|
||||
communication to establish a relative ordering.
|
||||
</p>
|
||||
|
||||
<h3 id="chan">Channel communication</h3>
|
||||
<h3>Channel communication</h3>
|
||||
|
||||
<p>
|
||||
Channel communication is the main method of synchronization
|
||||
@@ -358,8 +213,8 @@ usually in a different goroutine.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
A send on a channel is synchronized before the completion of the
|
||||
corresponding receive from that channel.
|
||||
A send on a channel happens before the corresponding
|
||||
receive from that channel completes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -384,13 +239,13 @@ func main() {
|
||||
|
||||
<p>
|
||||
is guaranteed to print <code>"hello, world"</code>. The write to <code>a</code>
|
||||
is sequenced before the send on <code>c</code>, which is synchronized before
|
||||
the corresponding receive on <code>c</code> completes, which is sequenced before
|
||||
happens before the send on <code>c</code>, which happens before
|
||||
the corresponding receive on <code>c</code> completes, which happens before
|
||||
the <code>print</code>.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The closing of a channel is synchronized before a receive that returns a zero value
|
||||
The closing of a channel happens before a receive that returns a zero value
|
||||
because the channel is closed.
|
||||
</p>
|
||||
|
||||
@@ -401,8 +256,8 @@ yields a program with the same guaranteed behavior.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
A receive from an unbuffered channel is synchronized before the completion of
|
||||
the corresponding send on that channel.
|
||||
A receive from an unbuffered channel happens before
|
||||
the send on that channel completes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -428,8 +283,8 @@ func main() {
|
||||
|
||||
<p>
|
||||
is also guaranteed to print <code>"hello, world"</code>. The write to <code>a</code>
|
||||
is sequenced before the receive on <code>c</code>, which is synchronized before
|
||||
the corresponding send on <code>c</code> completes, which is sequenced
|
||||
happens before the receive on <code>c</code>, which happens before
|
||||
the corresponding send on <code>c</code> completes, which happens
|
||||
before the <code>print</code>.
|
||||
</p>
|
||||
|
||||
@@ -441,7 +296,7 @@ crash, or do something else.)
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The <i>k</i>th receive on a channel with capacity <i>C</i> is synchronized before the completion of the <i>k</i>+<i>C</i>th send from that channel completes.
|
||||
The <i>k</i>th receive on a channel with capacity <i>C</i> happens before the <i>k</i>+<i>C</i>th send from that channel completes.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -475,7 +330,7 @@ func main() {
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3 id="locks">Locks</h3>
|
||||
<h3>Locks</h3>
|
||||
|
||||
<p>
|
||||
The <code>sync</code> package implements two lock data types,
|
||||
@@ -484,7 +339,7 @@ The <code>sync</code> package implements two lock data types,
|
||||
|
||||
<p class="rule">
|
||||
For any <code>sync.Mutex</code> or <code>sync.RWMutex</code> variable <code>l</code> and <i>n</i> < <i>m</i>,
|
||||
call <i>n</i> of <code>l.Unlock()</code> is synchronized before call <i>m</i> of <code>l.Lock()</code> returns.
|
||||
call <i>n</i> of <code>l.Unlock()</code> happens before call <i>m</i> of <code>l.Lock()</code> returns.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -510,29 +365,19 @@ func main() {
|
||||
|
||||
<p>
|
||||
is guaranteed to print <code>"hello, world"</code>.
|
||||
The first call to <code>l.Unlock()</code> (in <code>f</code>) is synchronized
|
||||
The first call to <code>l.Unlock()</code> (in <code>f</code>) happens
|
||||
before the second call to <code>l.Lock()</code> (in <code>main</code>) returns,
|
||||
which is sequenced before the <code>print</code>.
|
||||
which happens before the <code>print</code>.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
For any call to <code>l.RLock</code> on a <code>sync.RWMutex</code> variable <code>l</code>,
|
||||
there is an <i>n</i> such that the <i>n</i>th call to <code>l.Unlock</code>
|
||||
is synchronized before the return from <code>l.RLock</code>,
|
||||
and the matching call to <code>l.RUnlock</code> is synchronized before the return from call <i>n</i>+1 to <code>l.Lock</code>.
|
||||
there is an <i>n</i> such that the <code>l.RLock</code> happens (returns) after call <i>n</i> to
|
||||
<code>l.Unlock</code> and the matching <code>l.RUnlock</code> happens
|
||||
before call <i>n</i>+1 to <code>l.Lock</code>.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
A successful call to <code>l.TryLock</code> (or <code>l.TryRLock</code>)
|
||||
is equivalent to a call to <code>l.Lock</code> (or <code>l.RLock</code>).
|
||||
An unsuccessful call has no synchronizing effect at all.
|
||||
As far as the memory model is concerned,
|
||||
<code>l.TryLock</code> (or <code>l.TryRLock</code>)
|
||||
may be considered to be able to return false
|
||||
even when the mutex <i>l</i> is unlocked.
|
||||
</p>
|
||||
|
||||
<h3 id="once">Once</h3>
|
||||
<h3>Once</h3>
|
||||
|
||||
<p>
|
||||
The <code>sync</code> package provides a safe mechanism for
|
||||
@@ -544,8 +389,7 @@ until <code>f()</code> has returned.
|
||||
</p>
|
||||
|
||||
<p class="rule">
|
||||
The completion of a single call of <code>f()</code> from <code>once.Do(f)</code>
|
||||
is synchronized before the return of any call of <code>once.Do(f)</code>.
|
||||
A single call of <code>f()</code> from <code>once.Do(f)</code> happens (returns) before any call of <code>once.Do(f)</code> returns.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -580,60 +424,13 @@ The result will be that <code>"hello, world"</code> will be printed
|
||||
twice.
|
||||
</p>
|
||||
|
||||
<h3 id="atomic">Atomic Values</h3>
|
||||
<h2>Incorrect synchronization</h2>
|
||||
|
||||
<p>
|
||||
The APIs in the <a href="/pkg/sync/atomic/"><code>sync/atomic</code></a>
|
||||
package are collectively “atomic operations”
|
||||
that can be used to synchronize the execution of different goroutines.
|
||||
If the effect of an atomic operation <i>A</i> is observed by atomic operation <i>B</i>,
|
||||
then <i>A</i> is synchronized before <i>B</i>.
|
||||
All the atomic operations executed in a program behave as though executed
|
||||
in some sequentially consistent order.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The preceding definition has the same semantics as C++’s sequentially consistent atomics
|
||||
and Java’s <code>volatile</code> variables.
|
||||
</p>
|
||||
|
||||
<h3 id="finalizer">Finalizers</h3>
|
||||
|
||||
<p>
|
||||
The <a href="/pkg/runtime/"><code>runtime</code></a> package provides
|
||||
a <code>SetFinalizer</code> function that adds a finalizer to be called when
|
||||
a particular object is no longer reachable by the program.
|
||||
A call to <code>SetFinalizer(x, f)</code> is synchronized before the finalization call <code>f(x)</code>.
|
||||
</p>
|
||||
|
||||
<h3 id="more">Additional Mechanisms</h3>
|
||||
|
||||
<p>
|
||||
The <code>sync</code> package provides additional synchronization abstractions,
|
||||
including <a href="/pkg/sync/#Cond">condition variables</a>,
|
||||
<a href="/pkg/sync/#Map">lock-free maps</a>,
|
||||
<a href="/pkg/sync/#Pool">allocation pools</a>,
|
||||
and
|
||||
<a href="/pkg/sync/#WaitGroup">wait groups</a>.
|
||||
The documentation for each of these specifies the guarantees it
|
||||
makes concerning synchronization.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Other packages that provide synchronization abstractions
|
||||
should document the guarantees they make too.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="badsync">Incorrect synchronization</h2>
|
||||
|
||||
<p>
|
||||
Programs with races are incorrect and
|
||||
can exhibit non-sequentially consistent executions.
|
||||
In particular, note that a read <i>r</i> may observe the value written by any write <i>w</i>
|
||||
that executes concurrently with <i>r</i>.
|
||||
Even if this occurs, it does not imply that reads happening after <i>r</i>
|
||||
will observe writes that happened before <i>w</i>.
|
||||
Note that a read <span class="event">r</span> may observe the value written by a write <span class="event">w</span>
|
||||
that happens concurrently with <span class="event">r</span>.
|
||||
Even if this occurs, it does not imply that reads happening after <span class="event">r</span>
|
||||
will observe writes that happened before <span class="event">w</span>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -769,197 +566,3 @@ value for <code>g.msg</code>.
|
||||
In all these examples, the solution is the same:
|
||||
use explicit synchronization.
|
||||
</p>
|
||||
|
||||
<h2 id="badcompiler">Incorrect compilation</h2>
|
||||
|
||||
<p>
|
||||
The Go memory model restricts compiler optimizations as much as it does Go programs.
|
||||
Some compiler optimizations that would be valid in single-threaded programs are not valid in all Go programs.
|
||||
In particular, a compiler must not introduce writes that do not exist in the original program,
|
||||
it must not allow a single read to observe multiple values,
|
||||
and it must not allow a single write to write multiple values.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
All the following examples assume that `*p` and `*q` refer to
|
||||
memory locations accessible to multiple goroutines.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not introducing data races into race-free programs means not moving
|
||||
writes out of conditional statements in which they appear.
|
||||
For example, a compiler must not invert the conditional in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p = 1
|
||||
if cond {
|
||||
*p = 2
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That is, the compiler must not rewrite the program into this one:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p = 2
|
||||
if !cond {
|
||||
*p = 1
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If <code>cond</code> is false and another goroutine is reading <code>*p</code>,
|
||||
then in the original program, the other goroutine can only observe any prior value of <code>*p</code> and <code>1</code>.
|
||||
In the rewritten program, the other goroutine can observe <code>2</code>, which was previously impossible.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not introducing data races also means not assuming that loops terminate.
|
||||
For example, a compiler must in general not move the accesses to <code>*p</code> or <code>*q</code>
|
||||
ahead of the loop in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
n := 0
|
||||
for e := list; e != nil; e = e.next {
|
||||
n++
|
||||
}
|
||||
i := *p
|
||||
*q = 1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If <code>list</code> pointed to a cyclic list,
|
||||
then the original program would never access <code>*p</code> or <code>*q</code>,
|
||||
but the rewritten program would.
|
||||
(Moving `*p` ahead would be safe if the compiler can prove `*p` will not panic;
|
||||
moving `*q` ahead would also require the compiler proving that no other
|
||||
goroutine can access `*q`.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not introducing data races also means not assuming that called functions
|
||||
always return or are free of synchronization operations.
|
||||
For example, a compiler must not move the accesses to <code>*p</code> or <code>*q</code>
|
||||
ahead of the function call in this program
|
||||
(at least not without direct knowledge of the precise behavior of <code>f</code>):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
f()
|
||||
i := *p
|
||||
*q = 1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If the call never returned, then once again the original program
|
||||
would never access <code>*p</code> or <code>*q</code>, but the rewritten program would.
|
||||
And if the call contained synchronizing operations, then the original program
|
||||
could establish happens before edges preceding the accesses
|
||||
to <code>*p</code> and <code>*q</code>, but the rewritten program would not.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not allowing a single read to observe multiple values means
|
||||
not reloading local variables from shared memory.
|
||||
For example, a compiler must not discard <code>i</code> and reload it
|
||||
a second time from <code>*p</code> in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
i := *p
|
||||
if i < 0 || i >= len(funcs) {
|
||||
panic("invalid function index")
|
||||
}
|
||||
... complex code ...
|
||||
// compiler must NOT reload i = *p here
|
||||
funcs[i]()
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If the complex code needs many registers, a compiler for single-threaded programs
|
||||
could discard <code>i</code> without saving a copy and then reload
|
||||
<code>i = *p</code> just before
|
||||
<code>funcs[i]()</code>.
|
||||
A Go compiler must not, because the value of <code>*p</code> may have changed.
|
||||
(Instead, the compiler could spill <code>i</code> to the stack.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Not allowing a single write to write multiple values also means not using
|
||||
the memory where a local variable will be written as temporary storage before the write.
|
||||
For example, a compiler must not use <code>*p</code> as temporary storage in this program:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p = i + *p/2
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
That is, it must not rewrite the program into this one:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
*p /= 2
|
||||
*p += i
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If <code>i</code> and <code>*p</code> start equal to 2,
|
||||
the original code does <code>*p = 3</code>,
|
||||
so a racing thread can read only 2 or 3 from <code>*p</code>.
|
||||
The rewritten code does <code>*p = 1</code> and then <code>*p = 3</code>,
|
||||
allowing a racing thread to read 1 as well.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that all these optimizations are permitted in C/C++ compilers:
|
||||
a Go compiler sharing a back end with a C/C++ compiler must take care
|
||||
to disable optimizations that are invalid for Go.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that the prohibition on introducing data races
|
||||
does not apply if the compiler can prove that the races
|
||||
do not affect correct execution on the target platform.
|
||||
For example, on essentially all CPUs, it is valid to rewrite
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
n := 0
|
||||
for i := 0; i < m; i++ {
|
||||
n += *shared
|
||||
}
|
||||
</pre>
|
||||
|
||||
into:
|
||||
|
||||
<pre>
|
||||
n := 0
|
||||
local := *shared
|
||||
for i := 0; i < m; i++ {
|
||||
n += local
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
provided it can be proved that <code>*shared</code> will not fault on access,
|
||||
because the potential added read will not affect any existing concurrent reads or writes.
|
||||
On the other hand, the rewrite would not be valid in a source-to-source translator.
|
||||
</p>
|
||||
|
||||
<h2 id="conclusion">Conclusion</h2>
|
||||
|
||||
<p>
|
||||
Go programmers writing data-race-free programs can rely on
|
||||
sequentially consistent execution of those programs,
|
||||
just as in essentially all other modern programming languages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When it comes to programs with races,
|
||||
both programmers and compilers should remember the advice:
|
||||
don't be clever.
|
||||
</p>
|
||||
|
||||
188
doc/go_spec.html
188
doc/go_spec.html
@@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of June 29, 2022",
|
||||
"Subtitle": "Version of April 19, 2022",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
@@ -22,23 +22,20 @@ dependencies.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The syntax is compact and simple to parse, allowing for easy analysis
|
||||
The grammar is compact and simple to parse, allowing for easy analysis
|
||||
by automatic tools such as integrated development environments.
|
||||
</p>
|
||||
|
||||
<h2 id="Notation">Notation</h2>
|
||||
<p>
|
||||
The syntax is specified using a
|
||||
<a href="https://en.wikipedia.org/wiki/Wirth_syntax_notation">variant</a>
|
||||
of Extended Backus-Naur Form (EBNF):
|
||||
The syntax is specified using Extended Backus-Naur Form (EBNF):
|
||||
</p>
|
||||
|
||||
<pre class="grammar">
|
||||
Syntax = { Production } .
|
||||
Production = production_name "=" [ Expression ] "." .
|
||||
Expression = Term { "|" Term } .
|
||||
Term = Factor { Factor } .
|
||||
Factor = production_name | token [ "…" token ] | Group | Option | Repetition .
|
||||
Expression = Alternative { "|" Alternative } .
|
||||
Alternative = Term { Term } .
|
||||
Term = production_name | token [ "…" token ] | Group | Option | Repetition .
|
||||
Group = "(" Expression ")" .
|
||||
Option = "[" Expression "]" .
|
||||
Repetition = "{" Expression "}" .
|
||||
@@ -56,7 +53,7 @@ operators, in increasing precedence:
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Lowercase production names are used to identify lexical (terminal) tokens.
|
||||
Lower-case production names are used to identify lexical tokens.
|
||||
Non-terminals are in CamelCase. Lexical tokens are enclosed in
|
||||
double quotes <code>""</code> or back quotes <code>``</code>.
|
||||
</p>
|
||||
@@ -82,7 +79,7 @@ will use the unqualified term <i>character</i> to refer to a Unicode code point
|
||||
in the source text.
|
||||
</p>
|
||||
<p>
|
||||
Each code point is distinct; for instance, uppercase and lowercase letters
|
||||
Each code point is distinct; for instance, upper and lower case letters
|
||||
are different characters.
|
||||
</p>
|
||||
<p>
|
||||
@@ -99,13 +96,13 @@ A byte order mark may be disallowed anywhere else in the source.
|
||||
<h3 id="Characters">Characters</h3>
|
||||
|
||||
<p>
|
||||
The following terms are used to denote specific Unicode character categories:
|
||||
The following terms are used to denote specific Unicode character classes:
|
||||
</p>
|
||||
<pre class="ebnf">
|
||||
newline = /* the Unicode code point U+000A */ .
|
||||
unicode_char = /* an arbitrary Unicode code point except newline */ .
|
||||
unicode_letter = /* a Unicode code point categorized as "Letter" */ .
|
||||
unicode_digit = /* a Unicode code point categorized as "Number, decimal digit" */ .
|
||||
unicode_letter = /* a Unicode code point classified as "Letter" */ .
|
||||
unicode_digit = /* a Unicode code point classified as "Number, decimal digit" */ .
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -118,7 +115,7 @@ as Unicode letters, and those in the Number category Nd as Unicode digits.
|
||||
<h3 id="Letters_and_digits">Letters and digits</h3>
|
||||
|
||||
<p>
|
||||
The underscore character <code>_</code> (U+005F) is considered a lowercase letter.
|
||||
The underscore character <code>_</code> (U+005F) is considered a letter.
|
||||
</p>
|
||||
<pre class="ebnf">
|
||||
letter = unicode_letter | "_" .
|
||||
@@ -173,7 +170,7 @@ valid token.
|
||||
<h3 id="Semicolons">Semicolons</h3>
|
||||
|
||||
<p>
|
||||
The formal syntax uses semicolons <code>";"</code> as terminators in
|
||||
The formal grammar uses semicolons <code>";"</code> as terminators in
|
||||
a number of productions. Go programs may omit most of these semicolons
|
||||
using the following two rules:
|
||||
</p>
|
||||
@@ -263,7 +260,7 @@ continue for import return var
|
||||
|
||||
<p>
|
||||
The following character sequences represent <a href="#Operators">operators</a>
|
||||
(including <a href="#Assignment_statements">assignment operators</a>) and punctuation:
|
||||
(including <a href="#Assignments">assignment operators</a>) and punctuation:
|
||||
</p>
|
||||
<pre class="grammar">
|
||||
+ & += &= && == != ( )
|
||||
@@ -409,7 +406,7 @@ An imaginary literal represents the imaginary part of a
|
||||
<a href="#Constants">complex constant</a>.
|
||||
It consists of an <a href="#Integer_literals">integer</a> or
|
||||
<a href="#Floating-point_literals">floating-point</a> literal
|
||||
followed by the lowercase letter <code>i</code>.
|
||||
followed by the lower-case letter <code>i</code>.
|
||||
The value of an imaginary literal is the value of the respective
|
||||
integer or floating-point literal multiplied by the imaginary unit <i>i</i>.
|
||||
</p>
|
||||
@@ -502,9 +499,8 @@ After a backslash, certain single-character escapes represent special values:
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
An unrecognized character following a backslash in a rune literal is illegal.
|
||||
All other sequences starting with a backslash are illegal inside rune literals.
|
||||
</p>
|
||||
|
||||
<pre class="ebnf">
|
||||
rune_lit = "'" ( unicode_value | byte_value ) "'" .
|
||||
unicode_value = unicode_char | little_u_value | big_u_value | escaped_char .
|
||||
@@ -531,7 +527,6 @@ escaped_char = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `
|
||||
'\U00101234'
|
||||
'\'' // rune literal containing single quote character
|
||||
'aa' // illegal: too many characters
|
||||
'\k' // illegal: k is not recognized after a backslash
|
||||
'\xa' // illegal: too few hexadecimal digits
|
||||
'\0' // illegal: too few octal digits
|
||||
'\400' // illegal: octal value over 255
|
||||
@@ -676,7 +671,7 @@ containing only untyped constant operands are untyped.
|
||||
A constant may be given a type explicitly by a <a href="#Constant_declarations">constant declaration</a>
|
||||
or <a href="#Conversions">conversion</a>, or implicitly when used in a
|
||||
<a href="#Variable_declarations">variable declaration</a> or an
|
||||
<a href="#Assignment_statements">assignment statement</a> or as an
|
||||
<a href="#Assignments">assignment</a> or as an
|
||||
operand in an <a href="#Expressions">expression</a>.
|
||||
It is an error if the constant value
|
||||
cannot be <a href="#Representability">represented</a> as a value of the respective type.
|
||||
@@ -780,7 +775,7 @@ x = v // x has value (*T)(nil) and dynamic type *T
|
||||
<p>
|
||||
A variable's value is retrieved by referring to the variable in an
|
||||
<a href="#Expressions">expression</a>; it is the most recent value
|
||||
<a href="#Assignment_statements">assigned</a> to the variable.
|
||||
<a href="#Assignments">assigned</a> to the variable.
|
||||
If a variable has not yet been assigned a value, its value is the
|
||||
<a href="#The_zero_value">zero value</a> for its type.
|
||||
</p>
|
||||
@@ -802,7 +797,7 @@ TypeName = identifier | QualifiedIdent .
|
||||
TypeArgs = "[" TypeList [ "," ] "]" .
|
||||
TypeList = Type { "," Type } .
|
||||
TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType |
|
||||
SliceType | MapType | ChannelType .
|
||||
SliceType | MapType | ChannelType .
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -1027,7 +1022,7 @@ be <a href="#Uniqueness_of_identifiers">unique</a>.
|
||||
<pre class="ebnf">
|
||||
StructType = "struct" "{" { FieldDecl ";" } "}" .
|
||||
FieldDecl = (IdentifierList Type | EmbeddedField) [ Tag ] .
|
||||
EmbeddedField = [ "*" ] TypeName [ TypeArgs ] .
|
||||
EmbeddedField = [ "*" ] TypeName .
|
||||
Tag = string_lit .
|
||||
</pre>
|
||||
|
||||
@@ -1091,7 +1086,7 @@ of a struct except that they cannot be used as field names in
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Given a struct type <code>S</code> and a <a href="#Types">named type</a>
|
||||
Given a struct type <code>S</code> and a <a href="#Type_definitions">defined type</a>
|
||||
<code>T</code>, promoted methods are included in the method set of the struct as follows:
|
||||
</p>
|
||||
<ul>
|
||||
@@ -1591,7 +1586,7 @@ The number of map elements is called its length.
|
||||
For a map <code>m</code>, it can be discovered using the
|
||||
built-in function <a href="#Length_and_capacity"><code>len</code></a>
|
||||
and may change during execution. Elements may be added during execution
|
||||
using <a href="#Assignment_statements">assignments</a> and retrieved with
|
||||
using <a href="#Assignments">assignments</a> and retrieved with
|
||||
<a href="#Index_expressions">index expressions</a>; they may be removed with the
|
||||
<a href="#Deletion_of_map_elements"><code>delete</code></a> built-in function.
|
||||
</p>
|
||||
@@ -1634,7 +1629,7 @@ The optional <code><-</code> operator specifies the channel <i>direction</i>,
|
||||
<i>send</i> or <i>receive</i>. If a direction is given, the channel is <i>directional</i>,
|
||||
otherwise it is <i>bidirectional</i>.
|
||||
A channel may be constrained only to send or only to receive by
|
||||
<a href="#Assignment_statements">assignment</a> or
|
||||
<a href="#Assignments">assignment</a> or
|
||||
explicit <a href="#Conversions">conversion</a>.
|
||||
</p>
|
||||
|
||||
@@ -1811,31 +1806,6 @@ interface{ chan int | chan<- string } // channels have different element
|
||||
interface{ <-chan int | chan<- int } // directional channels have different directions
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Some operations (<a href="#Slice_expressions">slice expressions</a>,
|
||||
<a href="#Appending_and_copying_slices"><code>append</code> and <code>copy</code></a>)
|
||||
rely on a slightly more loose form of core types which accept byte slices and strings.
|
||||
Specifically, if there are exactly two types, <code>[]byte</code> and <code>string</code>,
|
||||
which are the underlying types of all types in the type set of interface <code>T</code>,
|
||||
the core type of <code>T</code> is called <code>bytestring</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Examples of interfaces with <code>bytestring</code> core types:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
interface{ int } // int (same as ordinary core type)
|
||||
interface{ []byte | string } // bytestring
|
||||
interface{ ~[]byte | myString } // bytestring
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note that <code>bytestring</code> is not a real type; it cannot be used to declare
|
||||
variables are compose other types. It exists solely to describe the behavior of some
|
||||
operations that read from a sequence of bytes, which may be a byte slice or a string.
|
||||
</p>
|
||||
|
||||
<h3 id="Type_identity">Type identity</h3>
|
||||
|
||||
<p>
|
||||
@@ -1950,8 +1920,7 @@ A value <code>x</code> of type <code>V</code> is <i>assignable</i> to a <a href=
|
||||
</li>
|
||||
<li>
|
||||
<code>V</code> and <code>T</code> have identical
|
||||
<a href="#Underlying_types">underlying types</a>
|
||||
but are not type parameters and at least one of <code>V</code>
|
||||
<a href="#Underlying_types">underlying types</a> and at least one of <code>V</code>
|
||||
or <code>T</code> is not a <a href="#Types">named type</a>.
|
||||
</li>
|
||||
<li>
|
||||
@@ -2189,8 +2158,9 @@ Go is lexically scoped using <a href="#Blocks">blocks</a>:
|
||||
or result variable is the function body.</li>
|
||||
|
||||
<li>The scope of an identifier denoting a type parameter of a function
|
||||
or declared by a method receiver begins after the name of the function
|
||||
and ends at the end of the function body.</li>
|
||||
or declared by a method receiver is the function body and all parameter lists of the
|
||||
function.
|
||||
</li>
|
||||
|
||||
<li>The scope of an identifier denoting a type parameter of a type
|
||||
begins after the name of the type and ends at the end
|
||||
@@ -2241,7 +2211,7 @@ the body of any nested function.
|
||||
The <i>blank identifier</i> is represented by the underscore character <code>_</code>.
|
||||
It serves as an anonymous placeholder instead of a regular (non-blank)
|
||||
identifier and has special meaning in <a href="#Declarations_and_scope">declarations</a>,
|
||||
as an <a href="#Operands">operand</a>, and in <a href="#Assignment_statements">assignment statements</a>.
|
||||
as an <a href="#Operands">operand</a>, and in <a href="#Assignments">assignments</a>.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -2276,8 +2246,8 @@ An identifier may be <i>exported</i> to permit access to it from another package
|
||||
An identifier is exported if both:
|
||||
</p>
|
||||
<ol>
|
||||
<li>the first character of the identifier's name is a Unicode uppercase
|
||||
letter (Unicode character category Lu); and</li>
|
||||
<li>the first character of the identifier's name is a Unicode upper case
|
||||
letter (Unicode class "Lu"); and</li>
|
||||
<li>the identifier is declared in the <a href="#Blocks">package block</a>
|
||||
or it is a <a href="#Struct_types">field name</a> or
|
||||
<a href="#MethodName">method name</a>.</li>
|
||||
@@ -2748,7 +2718,7 @@ var _, found = entries[name] // map lookup; only interested in "found"
|
||||
|
||||
<p>
|
||||
If a list of expressions is given, the variables are initialized
|
||||
with the expressions following the rules for <a href="#Assignment_statements">assignment statements</a>.
|
||||
with the expressions following the rules for <a href="#Assignments">assignments</a>.
|
||||
Otherwise, each variable is initialized to its <a href="#The_zero_value">zero value</a>.
|
||||
</p>
|
||||
|
||||
@@ -2792,7 +2762,7 @@ with initializer expressions but no types:
|
||||
</p>
|
||||
|
||||
<pre class="grammar">
|
||||
"var" IdentifierList "=" ExpressionList .
|
||||
"var" IdentifierList = ExpressionList .
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
@@ -2810,14 +2780,12 @@ variables provided they were originally declared earlier in the same block
|
||||
and at least one of the non-<a href="#Blank_identifier">blank</a> variables is new.
|
||||
As a consequence, redeclaration can only appear in a multi-variable short declaration.
|
||||
Redeclaration does not introduce a new variable; it just assigns a new value to the original.
|
||||
The non-blank variable names on the left side of <code>:=</code>
|
||||
must be <a href="#Uniqueness_of_identifiers">unique</a>.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
field1, offset := nextField(str, 0)
|
||||
field2, offset := nextField(str, offset) // redeclares offset
|
||||
x, y, x := 1, 2, 3 // illegal: x repeated on left side of :=
|
||||
a, a := 1, 2 // illegal: double declaration of a or no new variable if a was declared elsewhere
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -3011,7 +2979,7 @@ resulting operand is an <a href="#Instantiations">instantiated</a> function.
|
||||
|
||||
<p>
|
||||
The <a href="#Blank_identifier">blank identifier</a> may appear as an
|
||||
operand only on the left-hand side of an <a href="#Assignment_statements">assignment statement</a>.
|
||||
operand only on the left-hand side of an <a href="#Assignments">assignment</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -3042,7 +3010,7 @@ declared in the <a href="#Blocks">package block</a> of that package.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
math.Sin // denotes the Sin function in package math
|
||||
math.Sin // denotes the Sin function in package math
|
||||
</pre>
|
||||
|
||||
<h3 id="Composite_literals">Composite literals</h3>
|
||||
@@ -3056,7 +3024,7 @@ Each element may optionally be preceded by a corresponding key.
|
||||
<pre class="ebnf">
|
||||
CompositeLit = LiteralType LiteralValue .
|
||||
LiteralType = StructType | ArrayType | "[" "..." "]" ElementType |
|
||||
SliceType | MapType | TypeName [ TypeArgs ] .
|
||||
SliceType | MapType | TypeName .
|
||||
LiteralValue = "{" [ ElementList [ "," ] ] "}" .
|
||||
ElementList = KeyedElement { "," KeyedElement } .
|
||||
KeyedElement = [ Key ":" ] Element .
|
||||
@@ -3068,7 +3036,7 @@ Element = Expression | LiteralValue .
|
||||
<p>
|
||||
The LiteralType's <a href="#Core_types">core type</a> <code>T</code>
|
||||
must be a struct, array, slice, or map type
|
||||
(the syntax enforces this constraint except when the type is given
|
||||
(the grammar enforces this constraint except when the type is given
|
||||
as a TypeName).
|
||||
The types of the elements and keys must be <a href="#Assignability">assignable</a>
|
||||
to the respective field, element, and key types of type <code>T</code>;
|
||||
@@ -3821,7 +3789,7 @@ Otherwise <code>a[x]</code> is illegal.
|
||||
|
||||
<p>
|
||||
An index expression on a map <code>a</code> of type <code>map[K]V</code>
|
||||
used in an <a href="#Assignment_statements">assignment statement</a> or initialization of the special form
|
||||
used in an <a href="#Assignments">assignment</a> or initialization of the special form
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -3862,8 +3830,7 @@ a[low : high]
|
||||
|
||||
<p>
|
||||
constructs a substring or slice. The <a href="#Core_types">core type</a> of
|
||||
<code>a</code> must be a string, array, pointer to array, slice, or a
|
||||
<a href="#Core_types"><code>bytestring</code></a>.
|
||||
<code>a</code> must be a string, array, pointer to array, or slice.
|
||||
The <i>indices</i> <code>low</code> and
|
||||
<code>high</code> select which elements of operand <code>a</code> appear
|
||||
in the result. The result has indices starting at 0 and length equal to
|
||||
@@ -4037,7 +4004,7 @@ func f(y I) {
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A type assertion used in an <a href="#Assignment_statements">assignment statement</a> or initialization of the special form
|
||||
A type assertion used in an <a href="#Assignments">assignment</a> or initialization of the special form
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -4869,7 +4836,7 @@ due to two's-complement <a href="#Integer_overflow">integer overflow</a>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x, q
|
||||
x, q
|
||||
int8 -128
|
||||
int16 -32768
|
||||
int32 -2147483648
|
||||
@@ -5194,7 +5161,7 @@ f(<-ch)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
A receive expression used in an <a href="#Assignment_statements">assignment statement</a> or initialization of the special form
|
||||
A receive expression used in an <a href="#Assignments">assignment</a> or initialization of the special form
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -5273,7 +5240,7 @@ float32(0.49999999) // 0.5 of type float32
|
||||
float64(-1e-1000) // 0.0 of type float64
|
||||
string('x') // "x" of type string
|
||||
string(0x266c) // "♬" of type string
|
||||
myString("foo" + "bar") // "foobar" of type myString
|
||||
MyString("foo" + "bar") // "foobar" of type MyString
|
||||
string([]byte{'a'}) // not a constant: []byte{'a'} is not a constant
|
||||
(*int)(nil) // not a constant: nil is not a constant, *int is not a boolean, numeric, or string type
|
||||
int(1.2) // illegal: 1.2 cannot be represented as an int
|
||||
@@ -5456,9 +5423,8 @@ the range of valid Unicode code points are converted to <code>"\uFFFD"</code>.
|
||||
string('a') // "a"
|
||||
string(-1) // "\ufffd" == "\xef\xbf\xbd"
|
||||
string(0xf8) // "\u00f8" == "ø" == "\xc3\xb8"
|
||||
|
||||
type myString string
|
||||
myString(0x65e5) // "\u65e5" == "日" == "\xe6\x97\xa5"
|
||||
type MyString string
|
||||
MyString(0x65e5) // "\u65e5" == "日" == "\xe6\x97\xa5"
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -5471,12 +5437,8 @@ string([]byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}) // "hellø"
|
||||
string([]byte{}) // ""
|
||||
string([]byte(nil)) // ""
|
||||
|
||||
type bytes []byte
|
||||
string(bytes{'h', 'e', 'l', 'l', '\xc3', '\xb8'}) // "hellø"
|
||||
|
||||
type myByte byte
|
||||
string([]myByte{'w', 'o', 'r', 'l', 'd', '!'}) // "world!"
|
||||
myString([]myByte{'\xf0', '\x9f', '\x8c', '\x8d'}) // "🌍"
|
||||
type MyBytes []byte
|
||||
string(MyBytes{'h', 'e', 'l', 'l', '\xc3', '\xb8'}) // "hellø"
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -5490,12 +5452,8 @@ string([]rune{0x767d, 0x9d6c, 0x7fd4}) // "\u767d\u9d6c\u7fd4" == "白鵬翔"
|
||||
string([]rune{}) // ""
|
||||
string([]rune(nil)) // ""
|
||||
|
||||
type runes []rune
|
||||
string(runes{0x767d, 0x9d6c, 0x7fd4}) // "\u767d\u9d6c\u7fd4" == "白鵬翔"
|
||||
|
||||
type myRune rune
|
||||
string([]myRune{0x266b, 0x266c}) // "\u266b\u266c" == "♫♬"
|
||||
myString([]myRune{0x1f30e}) // "\U0001f30e" == "🌎"
|
||||
type MyRunes []rune
|
||||
string(MyRunes{0x767d, 0x9d6c, 0x7fd4}) // "\u767d\u9d6c\u7fd4" == "白鵬翔"
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -5504,13 +5462,10 @@ Converting a value of a string type to a slice of bytes type
|
||||
yields a slice whose successive elements are the bytes of the string.
|
||||
|
||||
<pre>
|
||||
[]byte("hellø") // []byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}
|
||||
[]byte("") // []byte{}
|
||||
[]byte("hellø") // []byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}
|
||||
[]byte("") // []byte{}
|
||||
|
||||
bytes("hellø") // []byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}
|
||||
|
||||
[]myByte("world!") // []myByte{'w', 'o', 'r', 'l', 'd', '!'}
|
||||
[]myByte(myString("🌏")) // []myByte{'\xf0', '\x9f', '\x8c', '\x8f'}
|
||||
MyBytes("hellø") // []byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -5519,13 +5474,10 @@ Converting a value of a string type to a slice of runes type
|
||||
yields a slice containing the individual Unicode code points of the string.
|
||||
|
||||
<pre>
|
||||
[]rune(myString("白鵬翔")) // []rune{0x767d, 0x9d6c, 0x7fd4}
|
||||
[]rune("") // []rune{}
|
||||
[]rune(MyString("白鵬翔")) // []rune{0x767d, 0x9d6c, 0x7fd4}
|
||||
[]rune("") // []rune{}
|
||||
|
||||
runes("白鵬翔") // []rune{0x767d, 0x9d6c, 0x7fd4}
|
||||
|
||||
[]myRune("♫♬") // []myRune{0x266b, 0x266c}
|
||||
[]myRune(myString("🌐")) // []myRune{0x1f310}
|
||||
MyRunes("白鵬翔") // []rune{0x767d, 0x9d6c, 0x7fd4}
|
||||
</pre>
|
||||
</li>
|
||||
</ol>
|
||||
@@ -5942,7 +5894,7 @@ IncDecStmt = Expression ( "++" | "--" ) .
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The following <a href="#Assignment_statements">assignment statements</a> are semantically
|
||||
The following <a href="#Assignments">assignment statements</a> are semantically
|
||||
equivalent:
|
||||
</p>
|
||||
|
||||
@@ -5953,14 +5905,7 @@ x-- x -= 1
|
||||
</pre>
|
||||
|
||||
|
||||
<h3 id="Assignment_statements">Assignment statements</h3>
|
||||
|
||||
<p>
|
||||
An <i>assignment</i> replaces the current value stored in a <a href="#Variables">variable</a>
|
||||
with a new value specified by an <a href="#Expressions">expression</a>.
|
||||
An assignment statement may assign a single value to a single variable, or multiple values to a
|
||||
matching number of variables.
|
||||
</p>
|
||||
<h3 id="Assignments">Assignments</h3>
|
||||
|
||||
<pre class="ebnf">
|
||||
Assignment = ExpressionList assign_op ExpressionList .
|
||||
@@ -6529,7 +6474,7 @@ is <code>nil</code>, the range expression blocks forever.
|
||||
|
||||
<p>
|
||||
The iteration values are assigned to the respective
|
||||
iteration variables as in an <a href="#Assignment_statements">assignment statement</a>.
|
||||
iteration variables as in an <a href="#Assignments">assignment statement</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -6864,8 +6809,7 @@ OuterLoop:
|
||||
|
||||
<p>
|
||||
A "continue" statement begins the next iteration of the
|
||||
innermost enclosing <a href="#For_statements">"for" loop</a>
|
||||
by advancing control to the end of the loop block.
|
||||
innermost <a href="#For_statements">"for" loop</a> at its post statement.
|
||||
The "for" loop must be within the same function.
|
||||
</p>
|
||||
|
||||
@@ -7191,7 +7135,7 @@ A constant size argument must be non-negative and <a href="#Representability">re
|
||||
by a value of type <code>int</code>; if it is an untyped constant it is given type <code>int</code>.
|
||||
If both <code>n</code> and <code>m</code> are provided and are constant, then
|
||||
<code>n</code> must be no larger than <code>m</code>.
|
||||
For slices and channels, if <code>n</code> is negative or larger than <code>m</code> at run time,
|
||||
If <code>n</code> is negative or larger than <code>m</code> at run time,
|
||||
a <a href="#Run_time_panics">run-time panic</a> occurs.
|
||||
</p>
|
||||
|
||||
@@ -7230,9 +7174,8 @@ The values <code>x</code> are passed to a parameter of type <code>...E</code>
|
||||
and the respective <a href="#Passing_arguments_to_..._parameters">parameter
|
||||
passing rules</a> apply.
|
||||
As a special case, if the core type of <code>s</code> is <code>[]byte</code>,
|
||||
<code>append</code> also accepts a second argument with core type
|
||||
<a href="#Core_types"><code>bytestring</code></a> followed by <code>...</code>.
|
||||
This form appends the bytes of the byte slice or string.
|
||||
<code>append</code> also accepts a second argument with core type <code>string</code>
|
||||
followed by <code>...</code>. This form appends the bytes of the string.
|
||||
</p>
|
||||
|
||||
<pre class="grammar">
|
||||
@@ -7269,9 +7212,8 @@ with <a href="#Type_identity">identical</a> element type.
|
||||
The number of elements copied is the minimum of
|
||||
<code>len(src)</code> and <code>len(dst)</code>.
|
||||
As a special case, if the destination's core type is <code>[]byte</code>,
|
||||
<code>copy</code> also accepts a source argument with core type
|
||||
</a> <a href="#Core_types"><code>bytestring</code></a>.
|
||||
This form copies the bytes from the byte slice or string into the byte slice.
|
||||
<code>copy</code> also accepts a source argument with core type <code>string</code>.
|
||||
This form copies the bytes from the string into the byte slice.
|
||||
</p>
|
||||
|
||||
<pre class="grammar">
|
||||
@@ -7585,7 +7527,7 @@ and the Unicode replacement character U+FFFD.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Consider a compiled a package containing the package clause
|
||||
Assume we have compiled a package containing the package clause
|
||||
<code>package math</code>, which exports function <code>Sin</code>, and
|
||||
installed the compiled package in the file identified by
|
||||
<code>"lib/math"</code>.
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# Consult https://www.iana.org/time-zones for the latest versions.
|
||||
|
||||
# Versions to use.
|
||||
CODE=2022a
|
||||
DATA=2022a
|
||||
CODE=2021e
|
||||
DATA=2021e
|
||||
|
||||
set -e
|
||||
rm -rf work
|
||||
|
||||
Binary file not shown.
108
misc/boring/README.md
Normal file
108
misc/boring/README.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# README.md
|
||||
|
||||
This directory holds build scripts for unofficial, unsupported
|
||||
distributions of Go+BoringCrypto.
|
||||
|
||||
## Version strings
|
||||
|
||||
The distribution name for a Go+BoringCrypto release has the form `<GoVersion>b<BoringCryptoVersion>`,
|
||||
where `<GoVersion>` is the Go version the release is based on, and `<BoringCryptoVersion>` is
|
||||
an integer that increments each time there is a new release with different BoringCrypto bits.
|
||||
The `<BoringCryptoVersion>` is stored in the `VERSION` file in this directory.
|
||||
|
||||
For example, the first release is based on Go 1.8.3 is `go1.8.3b1`.
|
||||
If the BoringCrypto bits are updated, the next would be `go1.8.3b2`.
|
||||
If, after that, Go 1.9 is released and the same BoringCrypto code added to it,
|
||||
that would result in `go1.9b2`. There would likely not be a `go1.9b1`,
|
||||
since that would indicate Go 1.9 with the older BoringCrypto code.
|
||||
|
||||
## Releases
|
||||
|
||||
The `build.release` script prepares a binary release and publishes it in Google Cloud Storage
|
||||
at `gs://go-boringcrypto/`, making it available for download at
|
||||
`https://go-boringcrypto.storage.googleapis.com/<FILE>`.
|
||||
The script records each published release in the `RELEASES` file in this directory.
|
||||
|
||||
The `build.docker` script, which must be run after `build.release`, prepares a Docker image
|
||||
and publishes it on Google Artifact Registry.
|
||||
`go1.17.2b7` is published as `us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.17.2b7`.
|
||||
|
||||
## Release process
|
||||
|
||||
Development is done on the dev.boringcrypto branch, which tracks
|
||||
master. Releases are cut from dev.boringcrypto.go1.X branches,
|
||||
which are BoringCrypto backported to the Go 1.X release branches.
|
||||
To issue new BoringCrypto releases based on Go 1.X:
|
||||
|
||||
1. If the BoringCrypto bits have been updated, increment the
|
||||
number in `VERSION`, send that change out as a CL for review,
|
||||
get it committed to dev.boringcrypto, and run `git sync`.
|
||||
|
||||
2. Change to the dev.boringcrypto.go1.X branch and cherry-pick
|
||||
all BoringCrypto updates, including the update of the
|
||||
`VERSION` file. If desired, merge release-branch.go1.X into
|
||||
dev.boringcrypto.go1.X. Mail them out and get them committed.
|
||||
|
||||
3. **Back on the dev.boringcrypto branch**, run `git fetch`,
|
||||
`make.bash` and then `build.release dev.boringcrypto.go1.X`.
|
||||
The script will determine the base Go version and the
|
||||
BoringCrypto version, build a release, and upload it.
|
||||
|
||||
4. Run `build.docker`, which will build and upload a Docker image
|
||||
from the latest release.
|
||||
|
||||
5. Send out a CL with the updated `RELEASES` file and get it
|
||||
committed to dev.boringcrypto.
|
||||
|
||||
## Building from Docker
|
||||
|
||||
A Dockerfile that starts with `FROM golang:1.17.2` can switch
|
||||
to `FROM us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:1.17.2b7`
|
||||
and should need no other modifications.
|
||||
|
||||
## Building from Bazel
|
||||
|
||||
Starting from [bazelbuild/rules_go](https://github.com/bazelbuild/rules_go)
|
||||
tag 0.7.1, simply download the BoringCrypto-enabled Go SDK using
|
||||
`go_download_sdk()` before calling `go_register_toolchains()`.
|
||||
|
||||
For example, to use Go 1.9.3 with BoringCrypto on Linux, use the following lines
|
||||
in `WORKSPACE`:
|
||||
```python
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_download_sdk", "go_register_toolchains")
|
||||
|
||||
go_rules_dependencies()
|
||||
|
||||
go_download_sdk(
|
||||
name = "go_sdk",
|
||||
sdks = {
|
||||
"linux_amd64": ("go1.9.3b4.linux-amd64.tar.gz", "db1997b2454a2f27669b849d2d2cafb247a55128d53da678f06cb409310d6660"),
|
||||
},
|
||||
urls = ["https://storage.googleapis.com/go-boringcrypto/{}"],
|
||||
)
|
||||
|
||||
go_register_toolchains()
|
||||
```
|
||||
|
||||
**Note**: you must *not* enable `pure` mode, since cgo must be enabled. To
|
||||
ensure that binaries are linked with BoringCrypto, you can set `pure = "off"` on
|
||||
all relevant `go_binary` rules.
|
||||
|
||||
## Caveat
|
||||
|
||||
BoringCrypto is used for a given build only in limited circumstances:
|
||||
|
||||
- The build must be GOOS=linux, GOARCH=amd64.
|
||||
- The build must have cgo enabled.
|
||||
- The android build tag must not be specified.
|
||||
- The cmd_go_bootstrap build tag must not be specified.
|
||||
|
||||
The version string reported by `runtime.Version` does not indicate that BoringCrypto
|
||||
was actually used for the build. For example, linux/386 and non-cgo linux/amd64 binaries
|
||||
will report a version of `go1.8.3b2` but not be using BoringCrypto.
|
||||
|
||||
To check whether a given binary is using BoringCrypto, run `go tool nm` on it and check
|
||||
that it has symbols named `*_Cfunc__goboringcrypto_*`.
|
||||
|
||||
The program [rsc.io/goversion](https://godoc.org/rsc.io/goversion) will report the
|
||||
crypto implementation used by a given binary when invoked with the `-crypto` flag.
|
||||
213
misc/boring/RELEASES
Normal file
213
misc/boring/RELEASES
Normal file
@@ -0,0 +1,213 @@
|
||||
# This file lists published Go+BoringCrypto releases.
|
||||
# Each line describes a single release: <version> <git commit> <target> <URL> <sha256sum>
|
||||
go1.9rc2b2 91753387bdf7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9rc2b2.linux-amd64.tar.gz 59355a45e6970e8013060851ddb3f079afe8db52e90db520a0826a13f1b5ae5b
|
||||
go1.8.3b3 f6ff81bac156 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.8.3b3.linux-amd64.tar.gz 6287ad971cd268bb2684fb8b1275dea928ad527823062bc057e73036c419e7af
|
||||
go1.9rc2b4 c339bc4e07a6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9rc2b4.linux-amd64.tar.gz a8f677d48dc93920065fca4dca1a55bf7110aba132489c47e25d26d55c67eb32
|
||||
go1.9b4 e6ad24cde71e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9b4.linux-amd64.tar.gz 6592e36a05df8e7c59812328a3a4bfa6c4eed72132fc31245951c3ade3ef2a8a
|
||||
go1.9b4 e6ad24cde71e src https://go-boringcrypto.storage.googleapis.com/go1.9b4.src.tar.gz c85f31dc743fee0e8ce0c6ffc286e27c1f51b66c9b923afafb43cdc378a41091
|
||||
go1.8.3b4 42cb4dcdb59a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.8.3b4.linux-amd64.tar.gz 4011c86e6175925e1c63dc7c19a51f825be53bbe7b08260918e5107b0fbd4f85
|
||||
go1.8.3b4 42cb4dcdb59a src https://go-boringcrypto.storage.googleapis.com/go1.8.3b4.src.tar.gz 2531ca8918aa024aed8f4a6c9e5c3b25bc8777623f1efa66aec7214601d474e4
|
||||
go1.9.2b4 cda3c6f91d7c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9.2b4.linux-amd64.tar.gz 7c5e9a033ddc3ab36646e3bac7fd16962742710c70c18122e44a9ab56cdd3cf7
|
||||
go1.9.2b4 cda3c6f91d7c src https://go-boringcrypto.storage.googleapis.com/go1.9.2b4.src.tar.gz 38a2260b64a6a5ab20f8972d08b4765bad116721356433f39aebd29c7598218c
|
||||
go1.9.3b4 f4e5ebdf35c8 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9.3b4.linux-amd64.tar.gz db1997b2454a2f27669b849d2d2cafb247a55128d53da678f06cb409310d6660
|
||||
go1.9.3b4 f4e5ebdf35c8 src https://go-boringcrypto.storage.googleapis.com/go1.9.3b4.src.tar.gz 7485e1fc53a9fab9cf34f71de74d69f4c50f9d11a449647de40ee04b59bf8a5b
|
||||
go1.9.7b4 0bad1bef406e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.9.7b4.linux-amd64.tar.gz 9e33a0deb8fed3bd7fa3d122bb5143be9e0a974a422ab4ddac5e765fa1310a6f
|
||||
go1.9.7b4 0bad1bef406e src https://go-boringcrypto.storage.googleapis.com/go1.9.7b4.src.tar.gz ad9fb6e22a27382c468467ecade4937f725b33818852f1c1da0d09b471e7486c
|
||||
go1.10.3b4 35ba5284935c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.3b4.linux-amd64.tar.gz 6754729d78a375bd1debd980b1e3e7fd49198a980d0bbd8f39e89569aa001942
|
||||
go1.10.3b4 35ba5284935c src https://go-boringcrypto.storage.googleapis.com/go1.10.3b4.src.tar.gz f3e75c60a835c11b97e30429b63917ceb31f799b2ba7e2001d99db908fb8e28f
|
||||
go1.10.4b4 2e2a04a605b6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.4b4.linux-amd64.tar.gz 17c275ff448686fe1908ecbea5d11ad6f4f7caa288d1786b756439703b12b8b2
|
||||
go1.10.4b4 2e2a04a605b6 src https://go-boringcrypto.storage.googleapis.com/go1.10.4b4.src.tar.gz f9cc38e194edabebf338fb74c22f597dc847560618d5d7d4d6cdc28139efa772
|
||||
go1.11b4 685dc1638240 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11b4.linux-amd64.tar.gz d53417b2071af0104fbc15a957000bccdcb5bbc094df0401f67d51968f7f2e4e
|
||||
go1.11b4 685dc1638240 src https://go-boringcrypto.storage.googleapis.com/go1.11b4.src.tar.gz 39896f0decd6721e81324cb2bb19540706ca97152c6800a6c8ad15a4e4162184
|
||||
go1.11.2b4 35cf0d9f6bbd linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.2b4.linux-amd64.tar.gz a9ceb6d0b4413d81ccc94c6460f60ca0c4f36b5dcbf659e1be582cd40c0edfbd
|
||||
go1.11.2b4 35cf0d9f6bbd src https://go-boringcrypto.storage.googleapis.com/go1.11.2b4.src.tar.gz 8e12a8df1428f00239dc67dd438a81f72c9925982e90b6899f66270971bddc1c
|
||||
go1.10.7b4 8b246fe0f595 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.7b4.linux-amd64.tar.gz 31917ab96004b9b482399b46928f5c10cdadefed5fda6f4de262efe2c3c7533e
|
||||
go1.10.7b4 8b246fe0f595 src https://go-boringcrypto.storage.googleapis.com/go1.10.7b4.src.tar.gz 323a184c77e3a377f5ed993b04946ee7b1a8e3350aba2894c0944f1e313636f1
|
||||
go1.11.4b4 572c4bce6792 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.4b4.linux-amd64.tar.gz e708ef7ecaf17a3e8e6deceadfa167cc1162f710f97ea4bc124d3837d6e2eaa1
|
||||
go1.11.4b4 572c4bce6792 src https://go-boringcrypto.storage.googleapis.com/go1.11.4b4.src.tar.gz ea963b80e218a34470e14e6e997fe06b8c5bf3f9c9bb0c801f7d8ef63b9bcb73
|
||||
go1.10.8b4 4b76b996cb0a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.10.8b4.linux-amd64.tar.gz 6d7d3323030851b595ba7ed66931c352b63de6dfe1ab3e6d6243987765d09819
|
||||
go1.10.8b4 4b76b996cb0a src https://go-boringcrypto.storage.googleapis.com/go1.10.8b4.src.tar.gz c1f5df50a4be3d0cb3aed7b80728f2b23c18deff0383636274742a38c145f939
|
||||
go1.11.5b4 3fb9dafacc45 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.5b4.linux-amd64.tar.gz 9b5b2972b452da9ba6bba65bab18fb9e8fbda31b5c489275710e5429d76f568c
|
||||
go1.11.5b4 3fb9dafacc45 src https://go-boringcrypto.storage.googleapis.com/go1.11.5b4.src.tar.gz 1c5801e2af25c9299d9fd94c64f9ec11fd35777c45d5d0f398c0a9884b1cfbbf
|
||||
go1.12.1b4 88e20e81a61f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.1b4.linux-amd64.tar.gz b71886e0d65e5efea2e0a3cbd0c3cd0daf84c437078e755ecde25f4ac0bbed2f
|
||||
go1.12.1b4 88e20e81a61f src https://go-boringcrypto.storage.googleapis.com/go1.12.1b4.src.tar.gz d44be1396eb2854b5d9c4d8e8ed0cf9fea1e9dc5a02d8f53b41ba571951a329f
|
||||
go1.11.6b4 7be8a5843a9b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.6b4.linux-amd64.tar.gz b704f61b8979e64a46da8884c90cd2b0e2d54e802d55e5f56d7c93752334c197
|
||||
go1.11.6b4 7be8a5843a9b src https://go-boringcrypto.storage.googleapis.com/go1.11.6b4.src.tar.gz a56b45e24b61ad7b3c90dfd906cd22426a4de9e2e697b4c9ef07a2af047bcb0d
|
||||
go1.12.5b4 ad495d31d908 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.5b4.linux-amd64.tar.gz df0e64958cf90f27a65b2175eb80bc34a601136eed8e5559bed2a9e349e33707
|
||||
go1.12.5b4 ad495d31d908 src https://go-boringcrypto.storage.googleapis.com/go1.12.5b4.src.tar.gz 054d482896a77ae2d7d24c7adf08da5a4401b938871e61a5cdabc735c54cea9f
|
||||
go1.11.11b4 346babe6a67f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.11b4.linux-amd64.tar.gz c4dd44fa00f491b3d2ea808af8a6c234f915adb27c014512d725bafc4784d75f
|
||||
go1.11.11b4 346babe6a67f src https://go-boringcrypto.storage.googleapis.com/go1.11.11b4.src.tar.gz 57a724a72f0ba8620cbb48288f39c86ed513c241509ddf73231f4c8cd2a983ac
|
||||
go1.12.6b4 6b86b09ad4d3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.6b4.linux-amd64.tar.gz eebc2e7f37555760adb361985b861d0cd34f9401cf7456d8d2f2f3082a60eee1
|
||||
go1.12.6b4 6b86b09ad4d3 src https://go-boringcrypto.storage.googleapis.com/go1.12.6b4.src.tar.gz 0e6e9aaf2c72a7e61280ce1e77b2ea24f01a59f4c1e6f0aa72b753206724fd3a
|
||||
go1.11.12b4 845e947ae34f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.12b4.linux-amd64.tar.gz 91808261fc357855fba920df01a933d6104e907793014317de00b92802d494d9
|
||||
go1.11.12b4 845e947ae34f src https://go-boringcrypto.storage.googleapis.com/go1.11.12b4.src.tar.gz 7b64d9e56ea627138d87c7533df8f9932a79ff900f150a8d8e6a3edc2d0066ec
|
||||
go1.12.7b4 bd126d0ad256 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.7b4.linux-amd64.tar.gz 7f0c73cd397bccad48ab4df4188d3651c25bf33102275848c6e67b882e11f680
|
||||
go1.12.7b4 bd126d0ad256 src https://go-boringcrypto.storage.googleapis.com/go1.12.7b4.src.tar.gz 0c48d7b81ef2b948980011fad1d176d6b10636a4016e3aed7438d86e046d816b
|
||||
go1.11.13b4 4f8e7223f936 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.11.13b4.linux-amd64.tar.gz eeb232577065732f5d57a4c77b7d73aa60231ee6fd6496daf7558993e92e403f
|
||||
go1.11.13b4 4f8e7223f936 src https://go-boringcrypto.storage.googleapis.com/go1.11.13b4.src.tar.gz 107da8846803a0a735766ca0947de6cd15cd23d8c584002f06e7ac5f81ecb114
|
||||
go1.12.8b4 55186ba70c1a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.8b4.linux-amd64.tar.gz 63f278abfc1e98546bc0ffc87f000d9aae2b06c0700212cb55ffd17d059fb8e1
|
||||
go1.12.8b4 55186ba70c1a src https://go-boringcrypto.storage.googleapis.com/go1.12.8b4.src.tar.gz c12b1d56ba4e0572f85a08681e05c66293ad53f04b11ce74c688d78fcb882061
|
||||
go1.12.9b4 ee88e5b118b5 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.9b4.linux-amd64.tar.gz d90989cba1db647b795400a9520eab2fa30f8dea50f4189b18d53f757a4bac44
|
||||
go1.12.9b4 ee88e5b118b5 src https://go-boringcrypto.storage.googleapis.com/go1.12.9b4.src.tar.gz 9d4efed8e13fa5ebdadd4fc22f9e35e67bfb34322570c83a15a0879472412e13
|
||||
go1.13b4 28e8a0c21e00 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13b4.linux-amd64.tar.gz 4a909f34bc487badb5ec11646c471ae690393d3f7835b8fbef8466d04ee23cba
|
||||
go1.13b4 28e8a0c21e00 src https://go-boringcrypto.storage.googleapis.com/go1.13b4.src.tar.gz 3c2dbe1bfcd7299b5be4b75529425c0a67b8d6b76f81f993b84ae0d173934257
|
||||
go1.12.10b4 5827153a1db7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.10b4.linux-amd64.tar.gz 20963fde89fd20eebee9d89003e52702f0379fdb04a68754f9fadf2c302166e3
|
||||
go1.12.10b4 5827153a1db7 src https://go-boringcrypto.storage.googleapis.com/go1.12.10b4.src.tar.gz f5cfe73cfeaaa67619ff4a4bbc587e622d63a6aaa7145253e6583bd59072b323
|
||||
go1.13.1b4 2da1832ad494 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.1b4.linux-amd64.tar.gz 70be1bae05feb67d0560f39767e80707343d96554c5a611fbb93b04ce5913693
|
||||
go1.13.1b4 2da1832ad494 src https://go-boringcrypto.storage.googleapis.com/go1.13.1b4.src.tar.gz cf94520325f376ecaf420b7d25756cdecbed52510a1a079eca67c2c86c3cf39b
|
||||
go1.12.11b4 c5a4ae8c8c1b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.11b4.linux-amd64.tar.gz a2d90aa130d45b36dd94a7e70accc94e2585eb45823fb7b07ae182ac8bc4a8ca
|
||||
go1.12.11b4 c5a4ae8c8c1b src https://go-boringcrypto.storage.googleapis.com/go1.12.11b4.src.tar.gz c334b70c9af0380fb9d397e89af1e2e2ac03380b5cc7c3327f56536c2f68bf8d
|
||||
go1.13.2b4 6a1c22797f9c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.2b4.linux-amd64.tar.gz 888c1f6331862af388e730fab4926aa1cb2d4ffc5417e32f9e6d2af7953f0e29
|
||||
go1.13.2b4 6a1c22797f9c src https://go-boringcrypto.storage.googleapis.com/go1.13.2b4.src.tar.gz fc44c7713fcd84fe0587594ae5ee1a1d318a0da18b1156e1f9645c6ffa0335bc
|
||||
go1.12.12b4 cab2e4707a42 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.12b4.linux-amd64.tar.gz 983e996e8f60c78a400fed0edfd16c1718d704e15389c48b4a8b2d835c0d00f2
|
||||
go1.12.12b4 cab2e4707a42 src https://go-boringcrypto.storage.googleapis.com/go1.12.12b4.src.tar.gz 2d653a74c14cde1e414ac558e0bdd182ccbe1198bbff8cd22c8e423552d5e24d
|
||||
go1.13.3b4 cba6efa89376 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.3b4.linux-amd64.tar.gz 9ba0b7696f14dc7ecc912aae6587491853637fab30c4c005339fe36751bfd185
|
||||
go1.13.3b4 cba6efa89376 src https://go-boringcrypto.storage.googleapis.com/go1.13.3b4.src.tar.gz ba83d7e18fa49dc6e4319806e7b5cdee5eb046eb8e9fb38f3034378c4f80944a
|
||||
go1.12.13b4 5d9d84d037da linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.13b4.linux-amd64.tar.gz af3e0d2b9996c632b010da6700b7b8ec52bd3065b3facc478709209a854664eb
|
||||
go1.12.13b4 5d9d84d037da src https://go-boringcrypto.storage.googleapis.com/go1.12.13b4.src.tar.gz d1bae336ea076a0b2bfc984477f4a216a475e134068227e6d9b44faf239bcfb8
|
||||
go1.13.4b4 fa3f24e5c294 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.4b4.linux-amd64.tar.gz 23579d1bea65b2510e507bb0698ec66777bd34674c91dfe617ed130728791dc7
|
||||
go1.13.4b4 fa3f24e5c294 src https://go-boringcrypto.storage.googleapis.com/go1.13.4b4.src.tar.gz 8d82df5b4332acd5a274ac029ee5b5ff073b2a4247e2325610986221858b819d
|
||||
go1.12.16b4 f74e68136cf1 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.16b4.linux-amd64.tar.gz fd70cee8ca9438f99cc71b3586b11a03a36239a5bccbf1c4d06e7206b88bd77d
|
||||
go1.12.16b4 f74e68136cf1 src https://go-boringcrypto.storage.googleapis.com/go1.12.16b4.src.tar.gz 2ae0823cefc34f280d4f4ba0d665ff247ba1429cb43198d10e3bc316d3f29a8d
|
||||
go1.13.7b4 71468339f763 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.7b4.linux-amd64.tar.gz 85945502ad43f506902927f69b514b34a85a20e2bd1020cce87c551645194aa3
|
||||
go1.13.7b4 71468339f763 src https://go-boringcrypto.storage.googleapis.com/go1.13.7b4.src.tar.gz d30fa252de75763adb5886125e19e8bab68dbe8dbad33b0faf09a6be98b12d96
|
||||
go1.12.17b4 9e5b1367cb45 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.12.17b4.linux-amd64.tar.gz ee3a72dc1cfd8a34f32aaa5ddb05076fcb39434fd1bd25aa318234f72b462e31
|
||||
go1.12.17b4 9e5b1367cb45 src https://go-boringcrypto.storage.googleapis.com/go1.12.17b4.src.tar.gz ffb653ec8f4cc33e1e7c308d89c695f322a76f3107e0fc8c639affc6148261bf
|
||||
go1.13.8b4 fdf5e5b5905f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.8b4.linux-amd64.tar.gz eac505df92aa6d6b76041f4b485d230f839159b8567c96d7980a06ef476ab3df
|
||||
go1.13.8b4 fdf5e5b5905f src https://go-boringcrypto.storage.googleapis.com/go1.13.8b4.src.tar.gz 1aa28fe37a704e94bb34e23578fd07ebbc6a025e9be9b45a898967b84405c41b
|
||||
go1.14b4 99da8fa53467 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14b4.linux-amd64.tar.gz a617e03a6c8813c53b813b865a2e185e12dbfaa76c703c1c48e57ad89651556b
|
||||
go1.14b4 99da8fa53467 src https://go-boringcrypto.storage.googleapis.com/go1.14b4.src.tar.gz ee292639b24923f519f1f0fe1ceaeca8d46feb8c15cf88e228346398c5848380
|
||||
go1.13.9b4 bb8a1014a32c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.9b4.linux-amd64.tar.gz 565e1a3c62dfc2586471b6ae189ada053a86fc51d88d2eac883a03731071bf77
|
||||
go1.13.9b4 bb8a1014a32c src https://go-boringcrypto.storage.googleapis.com/go1.13.9b4.src.tar.gz 536f0549e7bbdad32270a17d8a282667560b6da2d27a5e3580714338e70185ad
|
||||
go1.14.1b4 e784c3f4d925 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.1b4.linux-amd64.tar.gz 6570991396d531fb628e4c01d697eeee395104147d406aec5a8ba00a213ef63f
|
||||
go1.14.1b4 e784c3f4d925 src https://go-boringcrypto.storage.googleapis.com/go1.14.1b4.src.tar.gz 2c267c3114fa4683f51c281d216d3754b38d5d08144c3acc318cf37165b1b2da
|
||||
go1.13.10b4 b129f40bb33f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.10b4.linux-amd64.tar.gz a511b2e6ee7b71ca1411d6e4bb07ec33bb5b6974fd1dded77e00520d24d9d000
|
||||
go1.13.10b4 b129f40bb33f src https://go-boringcrypto.storage.googleapis.com/go1.13.10b4.src.tar.gz 5dfa44eea19b0be0c9c394fbbf89b2a14f84380a9d7b87e21eacba3ba030c44b
|
||||
go1.14.2b4 2b0d842f4b24 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.2b4.linux-amd64.tar.gz 82449a7ce57733c0cd3fa7feac89214706ff2b04e387b62619b8e2b8b388ffd9
|
||||
go1.14.2b4 2b0d842f4b24 src https://go-boringcrypto.storage.googleapis.com/go1.14.2b4.src.tar.gz bfcb44fa329d6a2eb5c4ef58bfa114d65b078bf69a361bb77e3ea52ec8975d14
|
||||
go1.13.12b4 488ca930b24a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.12b4.linux-amd64.tar.gz 63193aa2290af5d65d2d6bbddcd11d835d437a4e835954d605863f5b27a7661d
|
||||
go1.13.12b4 488ca930b24a src https://go-boringcrypto.storage.googleapis.com/go1.13.12b4.src.tar.gz 5b0aefb44ba2a08fedb5be0144810bc47559d7d8a6e61638c09dd261706d650e
|
||||
go1.14.4b4 fcdb6aa6ee5d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.4b4.linux-amd64.tar.gz 682f2167b3d619690b1385196776822b1d2c497607f67e2d19d92faf2bea0b4a
|
||||
go1.14.4b4 fcdb6aa6ee5d src https://go-boringcrypto.storage.googleapis.com/go1.14.4b4.src.tar.gz 2fb759023360f0d42ba434f0409da2460ff4386cab062557f97fe15122b4b4cd
|
||||
go1.13.14b4 852ccd9de7d1 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.14b4.linux-amd64.tar.gz 49c67d3a67fac60e18a264555392aa5925126a75ef0ba152ec315cc874eccb43
|
||||
go1.13.14b4 852ccd9de7d1 src https://go-boringcrypto.storage.googleapis.com/go1.13.14b4.src.tar.gz 7b7dfc62286a07d438370b09f38845acae99c592c6e147722b8f3c098ab8756a
|
||||
go1.14.6b4 8f53ffb15fd5 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.6b4.linux-amd64.tar.gz 953322287806a42d4a73e096aea45511a51a0a323086e98119edcb0dae866c9d
|
||||
go1.14.6b4 8f53ffb15fd5 src https://go-boringcrypto.storage.googleapis.com/go1.14.6b4.src.tar.gz 75fea7a60da4ca225473b500b2d5ce7c302ca7d22eedfdbd3444cd01e6b9f392
|
||||
go1.15b5 a15df605fc4a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15b5.linux-amd64.tar.gz ebcb2212bdb645a16ffc05a1d9b77c94553ed19a6ccbbc73e4868c64777eb70a
|
||||
go1.15b5 a15df605fc4a src https://go-boringcrypto.storage.googleapis.com/go1.15b5.src.tar.gz 7107665853228b2c18f56fec73e217fa3494ccf52c609be839cf6945d501c0f0
|
||||
go1.13.15b4 5622128a77b4 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.13.15b4.linux-amd64.tar.gz 8b45ec0e578dc0a0bc483c2d12c08fee5adbfb39f0854fbe9d45f7d628ed1697
|
||||
go1.13.15b4 5622128a77b4 src https://go-boringcrypto.storage.googleapis.com/go1.13.15b4.src.tar.gz 21eab29a61a43078cd8bcdbbbb4c82ca049a7e2e211aca0c95f6a306e288db4f
|
||||
go1.14.9b4 62cd3338eed7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.9b4.linux-amd64.tar.gz c81946294cbefa7a3abdf47733c720c3454418d6881c137a2e28f18ea40977aa
|
||||
go1.14.9b4 62cd3338eed7 src https://go-boringcrypto.storage.googleapis.com/go1.14.9b4.src.tar.gz e9c13c4daa10f6aac80b703f61f7e931af92e92146c8b140ae79e20e4af6bccd
|
||||
go1.15.2b5 dbc5602d1839 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.2b5.linux-amd64.tar.gz 30c04d854fc8990017ee8c180c1407a4f26c016e3a4134161bbf41c9d16452e3
|
||||
go1.15.2b5 dbc5602d1839 src https://go-boringcrypto.storage.googleapis.com/go1.15.2b5.src.tar.gz 67432c0b0a02aa6cc0c49ab285f1c6935a16dadfebd77dfabca7e31907240bc9
|
||||
go1.14.10b4 b5fc12785be4 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.10b4.linux-amd64.tar.gz d3aa38fb5108b43b155c21529190e73789df6ca0b37feafd43438aefe42f936e
|
||||
go1.14.10b4 b5fc12785be4 src https://go-boringcrypto.storage.googleapis.com/go1.14.10b4.src.tar.gz daf7603babc49935efdea5befb2ecad823771523a84d1ba6c0e8c10fac982d59
|
||||
go1.15.3b5 ed9dc25d693c linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.3b5.linux-amd64.tar.gz 34ec7ec094f5e9349f1612b5f6d8f014b3a7b37b6986aeedcd0fe7cf2dc76a62
|
||||
go1.15.3b5 ed9dc25d693c src https://go-boringcrypto.storage.googleapis.com/go1.15.3b5.src.tar.gz bc37727287366aabb47594717cebd0a759147d8b2eb4cd3a45a19317af199fe9
|
||||
go1.14.12b4 21ba30ad409a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.12b4.linux-amd64.tar.gz 7f9fb67a3c59fff24e3c51fa2a7435f4195cfb33844c9c2def27c162cc23604b
|
||||
go1.14.12b4 21ba30ad409a src https://go-boringcrypto.storage.googleapis.com/go1.14.12b4.src.tar.gz 948d7a77a4a890a7258102bcc7b63890f238061dfb6a4c06033660e727e87fcf
|
||||
go1.15.5b5 11087322f85d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.5b5.linux-amd64.tar.gz 9c97488137f1f560b3fff0d8a2a9c45d2de8790fb8952a42b46cc4633528fc48
|
||||
go1.15.5b5 11087322f85d src https://go-boringcrypto.storage.googleapis.com/go1.15.5b5.src.tar.gz ee933cb1a4b591794dbcce99740032506af25ee202765dcc6979feb5abc114fc
|
||||
go1.14.13b4 2bb8e5a94e8a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.13b4.linux-amd64.tar.gz 8fb6e1cefe5535ab704e1b4e26725095dcca0060490842a54dd93e7cd8b206cd
|
||||
go1.14.13b4 2bb8e5a94e8a src https://go-boringcrypto.storage.googleapis.com/go1.14.13b4.src.tar.gz 02e0c4871d12813aee1019bf189b77ccec99dab3a1d5b95ce6abdf85b1810703
|
||||
go1.15.6b5 f78276931172 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.6b5.linux-amd64.tar.gz 245c500f7da70fb2abd1a6021436ed48e2b97dbbdb394a759b0601dc69cf4e77
|
||||
go1.15.6b5 f78276931172 src https://go-boringcrypto.storage.googleapis.com/go1.15.6b5.src.tar.gz 6576a29d019405b14fdc98883fed33c766de2028fbbd3a743a241275275cc7e5
|
||||
go1.14.14b4 9cf003256bc3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.14b4.linux-amd64.tar.gz 7df65366d26a13c5be16f87f64e832e86db3b8b9ca1b5c6385e0e20bf79dc82f
|
||||
go1.14.14b4 9cf003256bc3 src https://go-boringcrypto.storage.googleapis.com/go1.14.14b4.src.tar.gz aaeda57e2b68ac72783c7aacded814ec660a91c1010c3139156c8e7def86f145
|
||||
go1.15.7b5 79ea7a16d7e3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.7b5.linux-amd64.tar.gz cb08962897e3802cda96f4ee915ed20fbde7d5d85e688759ef523d2e6ae44851
|
||||
go1.15.7b5 79ea7a16d7e3 src https://go-boringcrypto.storage.googleapis.com/go1.15.7b5.src.tar.gz aa7cb4beff82881cbff4a66e9e07a4004e49384a8fcc95204db9b2f48c12a235
|
||||
go1.15.8b5 2a0dd053ecfa linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.8b5.linux-amd64.tar.gz 9d897bf42a962b064cfc9bed182c18ade0a3f5857d6a075d93b73ca8fe3b1f3a
|
||||
go1.15.8b5 2a0dd053ecfa src https://go-boringcrypto.storage.googleapis.com/go1.15.8b5.src.tar.gz 57964e7762ab03f0ad17bc787585b1709decccf095b7f7d2e9fca61a71e09010
|
||||
go1.14.15b4 47419f9cac61 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.14.15b4.linux-amd64.tar.gz 82ba7297d26afcdade439de5621bdcb16e5261877f204aa60d03b5e07223a5c8
|
||||
go1.14.15b4 47419f9cac61 src https://go-boringcrypto.storage.googleapis.com/go1.14.15b4.src.tar.gz bf77b15f1d905753648db2d91e39c3a740b67b03dfff511aa25a360a78f9742a
|
||||
go1.16b7 67a0be0b437e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16b7.linux-amd64.tar.gz 56d4e41d55baece6b98bc66bdf772b0eb17518dd287f27c533225cd154ee0a38
|
||||
go1.16b7 67a0be0b437e src https://go-boringcrypto.storage.googleapis.com/go1.16b7.src.tar.gz 7d063cf1cbd252da8b2db54947e5f2f1402ac792e1ea6de76e05ab233f5badbd
|
||||
go1.15.9b5 055f1da6e6b9 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.9b5.linux-amd64.tar.gz 8e44de7d9d36d68e01c0454841f1becb93d4932bb16a623ed6d4de15ecba1239
|
||||
go1.15.9b5 055f1da6e6b9 src https://go-boringcrypto.storage.googleapis.com/go1.15.9b5.src.tar.gz dba0290da6ae46df8d68c6d027b7d6b4775d6dcf8ff9f3cb8a26dbd5b757e696
|
||||
go1.16.1b7 b9bd851b1452 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.1b7.linux-amd64.tar.gz 963f6a4fb8c5ff7668fb17ba52c3d905466058266556844aee79139f7e3c9521
|
||||
go1.16.1b7 b9bd851b1452 src https://go-boringcrypto.storage.googleapis.com/go1.16.1b7.src.tar.gz 8e6849010ae5f3280fea0f6fa6e5b07831ac6e6524a636fab41c0e4f77b529ba
|
||||
go1.15.10b5 229a39e34717 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.10b5.linux-amd64.tar.gz 7533b0307fd995deb9ef68d67899582c336a3c62387d19d03d10202129e9fad3
|
||||
go1.15.10b5 229a39e34717 src https://go-boringcrypto.storage.googleapis.com/go1.15.10b5.src.tar.gz adbaff96b2392a9ab5a20d15fec959983861ec6e554c3c9cd14aec586a0928b3
|
||||
go1.16.2b7 6d5f0ffc93e5 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.2b7.linux-amd64.tar.gz 2871d90630706eba9d3bd2838ec1c0a367c78c2c4f40e74ed75c294e2c5aa358
|
||||
go1.16.2b7 6d5f0ffc93e5 src https://go-boringcrypto.storage.googleapis.com/go1.16.2b7.src.tar.gz 8991c28e30bdd9b34076c2871ab69aac7f306dba08d202aa7301f3adb54ad9f3
|
||||
go1.15.11b5 be25192f119e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.11b5.linux-amd64.tar.gz c5aa34a83631b3736bc1ab37027bc4fc22eca2353035586a6255be7e29251f43
|
||||
go1.15.11b5 be25192f119e src https://go-boringcrypto.storage.googleapis.com/go1.15.11b5.src.tar.gz 05408824d64ac8ebb6c1d895017e605d45a2c4ebee28995136fe12f4833652d2
|
||||
go1.16.3b7 fcee6b930a01 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.3b7.linux-amd64.tar.gz afe15efce3c1fecc60994d7ba0d41daaa029fa5810c98737121dde7b38a5e2ac
|
||||
go1.16.3b7 fcee6b930a01 src https://go-boringcrypto.storage.googleapis.com/go1.16.3b7.src.tar.gz 5c86175ed86e6ae3826eb827cc51bdda770f22ffaf3258b11135a268153b5057
|
||||
go1.16.4b7 25aff96f4b49 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.4b7.linux-amd64.tar.gz de60f0620f46b1872813f72646fdece76be94f43c1abe84b69033c26f823a31f
|
||||
go1.16.4b7 25aff96f4b49 src https://go-boringcrypto.storage.googleapis.com/go1.16.4b7.src.tar.gz 5b537cf5598bc968764885f4d1f9820578d05d104a6cd7107bb3e443217f4983
|
||||
go1.15.12b5 03a15201e7e0 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.12b5.linux-amd64.tar.gz 9fadc65da7df036bfe702b3f9980e2ca2b184f13d09e8094244f58a866a2f6ee
|
||||
go1.15.12b5 03a15201e7e0 src https://go-boringcrypto.storage.googleapis.com/go1.15.12b5.src.tar.gz 81ec958d893f4ecf90111d09ceb79b36492266a39d1918a22e80443e1d399561
|
||||
go1.16.5b7 e4feea2ce841 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.5b7.linux-amd64.tar.gz 2085b246d7d6908f504d0f33c655c31c3ec6e1ae3d13a020ba58abcf1b6ea7a4
|
||||
go1.16.5b7 e4feea2ce841 src https://go-boringcrypto.storage.googleapis.com/go1.16.5b7.src.tar.gz cfe6cc16eb205d61414338c2b42fa2c4278831785b29e6b79712669418852ef4
|
||||
go1.15.13b5 9647f89f2ac2 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.13b5.linux-amd64.tar.gz 1ad1edeaf3b6bc7696978d4137f55c0b38b8d796a607b89f7f010004aaef60a6
|
||||
go1.15.13b5 9647f89f2ac2 src https://go-boringcrypto.storage.googleapis.com/go1.15.13b5.src.tar.gz 6cc9c5d23947a9dccc0e1afdff5d433398b09df1c5170596a826aac326ece457
|
||||
go1.15.14b5 ddf078e08dc6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.14b5.linux-amd64.tar.gz 8c4dbdc91e36f3d1db7f14b234973bfcb3b685fe4a6cb2e326ba9cf73a4260c2
|
||||
go1.15.14b5 ddf078e08dc6 src https://go-boringcrypto.storage.googleapis.com/go1.15.14b5.src.tar.gz 0022b68f04a5d8553cfd838d3fe226f18e7095194300b2be4fc49a689daf0e1b
|
||||
go1.16.6b7 6a6b41a8441e linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.6b7.linux-amd64.tar.gz f7f33064643ce0ab8ac1cede100e7eee8509a970178f5be961d9fba331226067
|
||||
go1.16.6b7 6a6b41a8441e src https://go-boringcrypto.storage.googleapis.com/go1.16.6b7.src.tar.gz a1079dd2df6aad3bad584c4187dab98a264075b56b1d257ba27d956340ff7bbf
|
||||
go1.15.15b5 dd96ded6c86b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.15.15b5.linux-amd64.tar.gz 719d818f70c6eb1e753910fe21624832cf3f719540f22f89863e959ff68c0001
|
||||
go1.15.15b5 dd96ded6c86b src https://go-boringcrypto.storage.googleapis.com/go1.15.15b5.src.tar.gz af2d44c8eef02e093c077c085fbe6964af0ca715f95f4bcea0809fa211cc4ded
|
||||
go1.16.7b7 0d02a0d966b6 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.7b7.linux-amd64.tar.gz d4ca2906640edd9299d12d8204aae0d848b497b79b92424d8705ae748e16f3c5
|
||||
go1.16.7b7 0d02a0d966b6 src https://go-boringcrypto.storage.googleapis.com/go1.16.7b7.src.tar.gz f65503abf459ba1d2f77d4d023fcebd19c62e7c34d3ffd0f1aebb598ffa153d9
|
||||
go1.16.9b7 35d5cd0dcfb9 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.9b7.linux-amd64.tar.gz 6659e3ea17474000d2ac2f4a887a4bac26ab8cf6a0b0779cbd41464a7de23645
|
||||
go1.16.9b7 35d5cd0dcfb9 src https://go-boringcrypto.storage.googleapis.com/go1.16.9b7.src.tar.gz 81a40da773e33230276446955f9ddc85c8ca121432d56842edad49212975a9bc
|
||||
go1.17.2b7 5f1867dc1e67 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.2b7.linux-amd64.tar.gz 60fd88def54b81e489ba2d2d80e5df32150ef1a62c0ece3ff869862141824c81
|
||||
go1.17.2b7 5f1867dc1e67 src https://go-boringcrypto.storage.googleapis.com/go1.17.2b7.src.tar.gz b00e746a053d5e70e27151b9461e5e3413c53bb88bc60e0db107a99284614d17
|
||||
go1.16.10b7 06a4b2790c5b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.10b7.linux-amd64.tar.gz 9720316c7d91fa0b6a31678745ad68c52c92e4027751602449fb2309c0c3f1de
|
||||
go1.16.10b7 06a4b2790c5b src https://go-boringcrypto.storage.googleapis.com/go1.16.10b7.src.tar.gz 742e1e904d82cd7a17fade53ab9001f5f88b7a3ee9358c587811762fc07cdaa3
|
||||
go1.17.3b7 5a371e30afcb linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.3b7.linux-amd64.tar.gz a5216d1e7401c734b3e29e8aad3c8608f094ae7d37b55e8815211e25922e4d19
|
||||
go1.17.3b7 5a371e30afcb src https://go-boringcrypto.storage.googleapis.com/go1.17.3b7.src.tar.gz 858595a95faf4c730ebe3d40ecba1705b79f7bc2a996fd044cb30da8d9c57534
|
||||
go1.17.4b7 95e6359f6a5d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.4b7.linux-amd64.tar.gz aa4a69709a08c7d83a6417f978a9e5f32207c0e9da82d39cceff7d9cdf657e59
|
||||
go1.17.4b7 95e6359f6a5d src https://go-boringcrypto.storage.googleapis.com/go1.17.4b7.src.tar.gz 0151f947e1da7a9cec63b06276b9ed4b92d2e5113ae254ebbdb9191b65c711f6
|
||||
go1.16.11b7 c884bd9ef2f1 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.11b7.linux-amd64.tar.gz 8edd1e42a88df0dbb99f1e1487149a856155f24711e19c17ba0f08d76254e2ca
|
||||
go1.16.11b7 c884bd9ef2f1 src https://go-boringcrypto.storage.googleapis.com/go1.16.11b7.src.tar.gz a50f8362af1e44011b342657cac80d817868c6d0f40a6d235c45abc81c16fb92
|
||||
go1.16.12b7 adecd3ffbec7 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.12b7.linux-amd64.tar.gz fd43c36e9bc926634c13e0dc3547046c55f3b5a2448473d8fb51c344ea726542
|
||||
go1.16.12b7 adecd3ffbec7 src https://go-boringcrypto.storage.googleapis.com/go1.16.12b7.src.tar.gz 891e21c67738b63b645ace56fbd3874ff9e8583865ee7907543ae43373411d64
|
||||
go1.17.5b7 dc52cfcd39cd linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.5b7.linux-amd64.tar.gz 92407bbc855fd05c5252a2ee2d4fcb6eb077cf64fd0d70da53ba7914c22ec1d7
|
||||
go1.17.5b7 dc52cfcd39cd src https://go-boringcrypto.storage.googleapis.com/go1.17.5b7.src.tar.gz 4c508aecce1b56e34a4e32605086994606c72010b7caedce7681c1019781c93e
|
||||
go1.16.13b7 bb93480d0093 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.13b7.linux-amd64.tar.gz cd98a2ea753edc9d0206b14b2d40d269ddaee1dea7bc59b91cb8a11fc575f738
|
||||
go1.16.13b7 bb93480d0093 src https://go-boringcrypto.storage.googleapis.com/go1.16.13b7.src.tar.gz e9f8f5f6769fed35924b364f2e1df8ad2fc491569189761047cec14ca5922ee1
|
||||
go1.17.6b7 cfad1ff84c45 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.6b7.linux-amd64.tar.gz 5b55a001fb80f9baaed621c2469977b9c9afe13b9afc6fd5712057856ab86f5d
|
||||
go1.17.6b7 cfad1ff84c45 src https://go-boringcrypto.storage.googleapis.com/go1.17.6b7.src.tar.gz 5178f595dea6d618f7cdf6b9e2346a1a28430b4d547996b766fcd5b34379ca2f
|
||||
go1.17.7b7 172559d22b5d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.7b7.linux-amd64.tar.gz a69bf0516affb8678873ba40c4ddbc8e3b01bfa8460f5c5f356dd53049d54322
|
||||
go1.17.7b7 172559d22b5d src https://go-boringcrypto.storage.googleapis.com/go1.17.7b7.src.tar.gz eff84edf4f676c691ac21747277e15777789be32dcaa53a0779737b280351453
|
||||
go1.16.14b7 e90b835f3071 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.14b7.linux-amd64.tar.gz 5024e1231d33b9dfffdd7821132dd32eccd42e7415f25618dc8c7304b335edd9
|
||||
go1.16.14b7 e90b835f3071 src https://go-boringcrypto.storage.googleapis.com/go1.16.14b7.src.tar.gz caef2ef601bcc588e6bcb511087c9620200723a4c74191b725fbda94c3be884b
|
||||
go1.17.8b7 4ea866a9969f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.8b7.linux-amd64.tar.gz 4a1fa2c8d77309e1ef5bafe7e80e75c06e70c0ae1212d9f3d95485017155491d
|
||||
go1.17.8b7 4ea866a9969f src https://go-boringcrypto.storage.googleapis.com/go1.17.8b7.src.tar.gz e42ac342c315d33c47434299a24f33137e7099f278ee6669404c4d7e49e17bcf
|
||||
go1.16.15b7 649671b08fbd linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.16.15b7.linux-amd64.tar.gz 4d62f517786266019c721c35330e23da123eb184eadb5a79379fe81d31d856db
|
||||
go1.16.15b7 649671b08fbd src https://go-boringcrypto.storage.googleapis.com/go1.16.15b7.src.tar.gz 54fc7f2ec0b72b0aaf7726eb5f7f57885252ef46c2c1ca238090cc57850e3ef7
|
||||
go1.18b7 0622ea4d9068 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18b7.linux-amd64.tar.gz baa33bc66b8df97a3c5a328637b85f04d5629f139dc2df946c09ab7214510c61
|
||||
go1.18b7 0622ea4d9068 src https://go-boringcrypto.storage.googleapis.com/go1.18b7.src.tar.gz 6028ffee59903934a3182d45ee3e0c1c9f47fb98f05d9bbb2fabb4771db60792
|
||||
go1.18.1b7 d003f0850a7d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.1b7.linux-amd64.tar.gz a5b3985341de6ca54f6a8e13e9ae695f0ee202207e25f082c3895a8fc6f89f64
|
||||
go1.18.1b7 d003f0850a7d src https://go-boringcrypto.storage.googleapis.com/go1.18.1b7.src.tar.gz c7f91549b3a197e4a08f64e07546855ca8f82d597f60fd23c7ad2f082640a9fe
|
||||
go1.17.9b7 ed86dfc4e441 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.9b7.linux-amd64.tar.gz 9469d1b4c10f59c921c4666c52baba5f6ca63b1cce0eca95e03b5713ef27577c
|
||||
go1.17.9b7 ed86dfc4e441 src https://go-boringcrypto.storage.googleapis.com/go1.17.9b7.src.tar.gz 5d6bfe543a9a2bf6d8749973c771e40127b8020a769ecc5fb41d0dbd7deae9a6
|
||||
go1.18.2b7 dcdb19874ff3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.2b7.linux-amd64.tar.gz a53566eebe8e128695ddbd52c080502a0daca1c9f1b893cada9349259ed27e99
|
||||
go1.18.2b7 dcdb19874ff3 src https://go-boringcrypto.storage.googleapis.com/go1.18.2b7.src.tar.gz 3c3ce00cd39cdd2ae9afddd7581c6f8b14f8e96e2bb56b9cb4fec8ff02db63b0
|
||||
go1.17.10b7 6b07de790c08 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.10b7.linux-amd64.tar.gz 3c506a86b1e3e4fcffd6a875e5d47ca23f0a346c1bd6e6163e67dbb96eeec1d5
|
||||
go1.17.10b7 6b07de790c08 src https://go-boringcrypto.storage.googleapis.com/go1.17.10b7.src.tar.gz 9d5914842ea1b36edc2ceb6cfa7d3a79bea450c8b397e86bfae7c73944208f03
|
||||
go1.18.3b7 a69db81af596 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.3b7.linux-amd64.tar.gz 1c13ddfb539141298ee32d26b95345cacdcd245c29fb6bc63acb59f9ba41f519
|
||||
go1.18.3b7 a69db81af596 src https://go-boringcrypto.storage.googleapis.com/go1.18.3b7.src.tar.gz d8123121c491569c698ef713001a2193f13d9a8111a1ba7b2b0d4a2e9bf863db
|
||||
go1.17.11b7 4658e6e324a8 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.11b7.linux-amd64.tar.gz 104a5b10037e7a2646b0458519bf6efe85c6d203ae9f32ede7ed24d4e87f7b2d
|
||||
go1.17.11b7 4658e6e324a8 src https://go-boringcrypto.storage.googleapis.com/go1.17.11b7.src.tar.gz 85a6d4249e38decdaad0cffe784cbe249199e38a18db1c247097a5f91f5d9c10
|
||||
go1.18.4b7 913e3713bed3 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.4b7.linux-amd64.tar.gz 24be93f9718bfb4b7703fe959a69c61e103a0149dda693406cd681f7e00cf6fb
|
||||
go1.18.4b7 913e3713bed3 src https://go-boringcrypto.storage.googleapis.com/go1.18.4b7.src.tar.gz 572ce2d917c06ca87ccd3e51e02e0ad4a09eb0ad283cc762176d11d7cd4777af
|
||||
go1.17.12b7 7d5078e3bf2d linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.12b7.linux-amd64.tar.gz f1a075501f89d1b726a0a71611019679c77944e6ab253991aad79df73859d20a
|
||||
go1.17.12b7 7d5078e3bf2d src https://go-boringcrypto.storage.googleapis.com/go1.17.12b7.src.tar.gz aa7e6eccf8d8ee1fd270eb5acba58b6416ad97decae32ca7eee03193a70defa6
|
||||
go1.18.5b7 270c7b73de4a linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.5b7.linux-amd64.tar.gz 104479cff67e4c749304d95dd5b5e0d065a65780ec03b6378a28432c01504e88
|
||||
go1.18.5b7 270c7b73de4a src https://go-boringcrypto.storage.googleapis.com/go1.18.5b7.src.tar.gz 75f5021bd9b61f837fdd516cc4ec51556c519c7155a2e99ecfb4efeca8655aa7
|
||||
go1.17.13b7 349da2d42d31 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.17.13b7.linux-amd64.tar.gz 489151867b1454ea17d8a02bebb443121623c63585a15c2640e043c432c2d1ef
|
||||
go1.17.13b7 349da2d42d31 src https://go-boringcrypto.storage.googleapis.com/go1.17.13b7.src.tar.gz 8c86eede1718d45a8f934df2b158eb30b5d323255e5ff8885c81319f973f464e
|
||||
go1.18.6b7 5fe109f32326 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.6b7.linux-amd64.tar.gz a81c54b6dfd0750998be758a54ae46ecd5f1442c303c5146e844568c02acb47f
|
||||
go1.18.6b7 5fe109f32326 src https://go-boringcrypto.storage.googleapis.com/go1.18.6b7.src.tar.gz 0afc7b1edb8b7570ba05bc30b112804280b1cc5750e1a3dc8500be5c8b8ba06f
|
||||
go1.18.7b7 e3d1f0e7da63 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.7b7.linux-amd64.tar.gz 96694715f7d8122670a5e919b122470817041077e0f98ffd2c2643df5824ee82
|
||||
go1.18.7b7 e3d1f0e7da63 src https://go-boringcrypto.storage.googleapis.com/go1.18.7b7.src.tar.gz c62ba13f792f64f31381d34a7d6b14aec0b04363eb67085b999d1d6e51a94136
|
||||
go1.18.8b7 94108e21ab6f linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.8b7.linux-amd64.tar.gz 9df1f697273b29a5f8b23e5ed2bfd187237d886c2ebac360f457537c7b17dcd8
|
||||
go1.18.8b7 94108e21ab6f src https://go-boringcrypto.storage.googleapis.com/go1.18.8b7.src.tar.gz c3028846650b42cf77c1c0d540791eaa1283c8e60e2a87e28ae43658ffdc262a
|
||||
go1.18.9b7 fc1ed37e824b linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.9b7.linux-amd64.tar.gz 65f15218ed55697de24d4f58f43ed3c1ff35eb59462aab8002554cc479bf573c
|
||||
go1.18.9b7 fc1ed37e824b src https://go-boringcrypto.storage.googleapis.com/go1.18.9b7.src.tar.gz 45b1ed1d3f63d1fa86c6f26329f11912c1dbfb1fa4fd39cf0eabc84e29f86cd7
|
||||
go1.18.10b7 7058c2cb4132 linux-amd64 https://go-boringcrypto.storage.googleapis.com/go1.18.10b7.linux-amd64.tar.gz 17897c0f3716c8bc8ad3db9a41b7b35820b9d43cff3982193808f9af13e7dae5
|
||||
go1.18.10b7 7058c2cb4132 src https://go-boringcrypto.storage.googleapis.com/go1.18.10b7.src.tar.gz 4ced930d738cb30f4c4b28b7281d1e2e397eda2353b4c8f7c6de82ef589acc0b
|
||||
1
misc/boring/VERSION
Normal file
1
misc/boring/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
58
misc/boring/build.docker
Executable file
58
misc/boring/build.docker
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2017 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.
|
||||
|
||||
# build.docker builds and publishes a Docker image for
|
||||
# a given Go+BoringCrypto release.
|
||||
|
||||
set -e
|
||||
|
||||
# With no arguments, use the most recent linux-amd64 release in the RELEASES file.
|
||||
case "$#" in
|
||||
0)
|
||||
version=$(grep linux-amd64 RELEASES | tail -1 | awk '{print $1}');;
|
||||
1)
|
||||
version="$1";;
|
||||
*)
|
||||
echo 'usage: build.docker [version]' >&2
|
||||
exit 2
|
||||
esac
|
||||
|
||||
url="$(grep "^$version .* linux-amd64 " RELEASES | awk '{print $4}')"
|
||||
sha256="$(grep "^$version .* linux-amd64 " RELEASES | awk '{print $5}')"
|
||||
if [ "$sha256" = "" ]; then
|
||||
echo "cannot find $version in RELEASES file" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Build a temporary directory with a Dockerfile.
|
||||
dir=$(mktemp -d)
|
||||
trap "rm -rf $dir" EXIT
|
||||
|
||||
if echo "$url" | grep '!' >/dev/null; then
|
||||
# ! is sed delimiter below. Should never happen.
|
||||
echo "URL contains an exclamation mark!" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
dversion=$(echo "$version" | sed 's/^go//')
|
||||
sed "s!UUU!$url!; s/SSS/$sha256/; s/VVV/$dversion/" dockerfile.in >$dir/Dockerfile
|
||||
|
||||
dpkg=us-docker.pkg.dev/google.com/api-project-999119582588/go-boringcrypto/golang:$dversion
|
||||
|
||||
docker build --pull -t $dpkg $dir
|
||||
docker run $dpkg go version
|
||||
docker run $dpkg go tool nm /usr/local/go/bin/go >$dir/nm
|
||||
if ! grep crypto/internal/boring/sig.BoringCrypto $dir/nm >/dev/null; then
|
||||
echo 'built docker image but did NOT find sig.BoringCrypto in go command!' >&2
|
||||
exit 2
|
||||
fi
|
||||
if egrep 'crypto/sha256\.\(\*digest\)' $dir/nm >/dev/null; then
|
||||
echo 'built docker image but DID find sha256.(*digest) in go command unexpectedly!' >&2
|
||||
exit 2
|
||||
fi
|
||||
docker push $dpkg
|
||||
|
||||
echo
|
||||
echo published as $dpkg
|
||||
102
misc/boring/build.release
Executable file
102
misc/boring/build.release
Executable file
@@ -0,0 +1,102 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2017 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.
|
||||
|
||||
# build.release builds and publishes a new Go+BoringCrypto release.
|
||||
# After running this script, the change to the RELEASES file should be
|
||||
# sent out for review and committed to the repository (but the release
|
||||
# is already done, so there's not much to review).
|
||||
|
||||
set -e
|
||||
|
||||
case "$#" in
|
||||
0)
|
||||
rev=HEAD;;
|
||||
1)
|
||||
rev="$1";;
|
||||
*)
|
||||
echo 'usage: build.release [git-rev]' >&2
|
||||
exit 2
|
||||
esac
|
||||
|
||||
# Determine commit to use.
|
||||
commit=$(git rev-parse "$rev" | awk '{print substr($1, 1, 12)}')
|
||||
if [ "$commit" = "" ]; then
|
||||
echo 'cannot find commit in git history' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Determine base Go release from tags.
|
||||
base=$(git log --decorate=short --oneline "$rev" | grep 'tag: go' | sed 1q | sed 's/[),].*//; s/.*tag: //')
|
||||
if [ "$base" = "" ]; then
|
||||
echo "cannot find go release tag in git history for $rev" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Determine boring crypto version from file.
|
||||
boring=$(git show "$commit:misc/boring/VERSION")
|
||||
if [ "$boring" = "" ]; then
|
||||
echo "missing BORINGVERSION file in $commit" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Make sure we're not redefining a published release.
|
||||
version="${base}b${boring}"
|
||||
if grep "^$version " RELEASES >/dev/null; then
|
||||
echo "found $version in RELEASES - not rereleasing" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Show what's going on, while the release builds.
|
||||
# Good time for user to type ^C if something is wrong.
|
||||
echo >&2
|
||||
echo "building $version from $commit" >&2
|
||||
echo >&2
|
||||
git log -n1 "$commit" >&2
|
||||
echo >&2
|
||||
|
||||
# Build the release tool in a temporary directory.
|
||||
dir=$(mktemp -d)
|
||||
trap "rm -rf $dir" EXIT
|
||||
GOBIN="$dir" go install golang.org/x/build/cmd/release@latest
|
||||
|
||||
# Build the release.
|
||||
sha() {
|
||||
if hash sha256sum 2>/dev/null; then
|
||||
sha256sum "$@"
|
||||
else
|
||||
shasum -a 256 "$@"
|
||||
fi
|
||||
}
|
||||
shortgo=$(echo "$base" | perl -pe 's/(go\d+\.\d+)(\.\d+|rc\d+)/$1/')
|
||||
$dir/release -target linux-amd64 -rev "$commit" -version "$version" -skip_long_tests
|
||||
$dir/release -target src -rev "$commit" -version "$version"
|
||||
output="$version.linux-amd64.tar.gz"
|
||||
ls -l "$output"
|
||||
sha256=$(sha "$output" | awk '{print $1}')
|
||||
outputsrc="$version.src.tar.gz"
|
||||
ls -l "$outputsrc"
|
||||
sha256src=$(sha "$outputsrc" | awk '{print $1}')
|
||||
|
||||
trap "rm -f /tmp/go.release.$$ /tmp/go.nm.$$" EXIT
|
||||
tar -xzf "$output" -O go/bin/go >/tmp/go.release.$$
|
||||
go tool nm /tmp/go.release.$$ >/tmp/go.nm.$$
|
||||
if ! grep crypto/internal/boring/sig.BoringCrypto /tmp/go.nm.$$ >/dev/null; then
|
||||
echo 'built release but did NOT find sig.BoringCrypto in go command!' >&2
|
||||
exit 2
|
||||
fi
|
||||
if egrep 'crypto/sha256\.\(\*digest\)' /tmp/go.nm.$$ >/dev/null; then
|
||||
echo 'built release but DID find sha256.(*digest) in go command unexpectedly!' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Publish the release.
|
||||
gsutil cp "$output" gs://go-boringcrypto/
|
||||
url="https://go-boringcrypto.storage.googleapis.com/$output"
|
||||
gsutil cp "$outputsrc" gs://go-boringcrypto/
|
||||
urlsrc="https://go-boringcrypto.storage.googleapis.com/$outputsrc"
|
||||
|
||||
# Record that it was published.
|
||||
echo "$version $commit linux-amd64 $url $sha256" >>RELEASES
|
||||
echo "$version $commit src $urlsrc $sha256src" >>RELEASES
|
||||
31
misc/boring/dockerfile.in
Normal file
31
misc/boring/dockerfile.in
Normal file
@@ -0,0 +1,31 @@
|
||||
# Template for Dockerfile, used in build.docker script.
|
||||
# Based on https://github.com/docker-library/golang/blob/7e3d99a803/1.13/buster/Dockerfile
|
||||
FROM buildpack-deps:buster-scm
|
||||
|
||||
# gcc for cgo
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
g++ \
|
||||
gcc \
|
||||
libc6-dev \
|
||||
make \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV GOLANG_VERSION VVV
|
||||
|
||||
RUN set -eux; \
|
||||
\
|
||||
url="UUU"; \
|
||||
wget -O go.tgz "$url"; \
|
||||
echo "SSS go.tgz" | sha256sum -c -; \
|
||||
tar -C /usr/local -xzf go.tgz; \
|
||||
rm go.tgz; \
|
||||
\
|
||||
export PATH="/usr/local/go/bin:$PATH"; \
|
||||
go version
|
||||
|
||||
ENV GOPATH /go
|
||||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
|
||||
|
||||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
|
||||
WORKDIR $GOPATH
|
||||
34
misc/boring/merge.sh
Executable file
34
misc/boring/merge.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#! /bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "usage: merge.sh <target branch> <source revision>"
|
||||
echo ""
|
||||
echo "example: merge.sh dev.boringcrypto master"
|
||||
echo " merge.sh dev.boringcrypto.go1.10 go1.10.7"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGET="$1"
|
||||
SOURCE="$2"
|
||||
WORKTREE="$(mktemp -d)"
|
||||
BRANCH="boring/merge-$TARGET-$(date +%Y%m%d%H%M%S)"
|
||||
|
||||
git fetch
|
||||
git worktree add --track -b "$BRANCH" "$WORKTREE" "origin/$TARGET"
|
||||
|
||||
cd "$WORKTREE"
|
||||
export GIT_GOFMT_HOOK=off
|
||||
git merge --no-commit --no-stat "$SOURCE" || echo "Ignoring conflict..."
|
||||
[[ -f VERSION ]] && git rm -f VERSION
|
||||
git checkout --ours codereview.cfg && git add codereview.cfg
|
||||
git commit -m "all: merge $SOURCE into $TARGET"
|
||||
|
||||
if ! git log --format=%B -n 1 | grep "\[$TARGET\] "; then
|
||||
echo "The commit does not seem to be targeting the BoringCrypto branch."
|
||||
echo "(Or you are missing the git-codereview hooks.)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git codereview mail -trybot HEAD
|
||||
cd - && git worktree remove "$WORKTREE"
|
||||
34
misc/boring/release.sh
Executable file
34
misc/boring/release.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#! /bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo "usage: <target branch> [<target branch> ...]"
|
||||
echo ""
|
||||
echo "example: release.sh dev.boringcrypto.go1.11 dev.boringcrypto.go1.12"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check that the Docker daemon is available.
|
||||
docker ps > /dev/null
|
||||
|
||||
WORKTREE="$(mktemp -d)"
|
||||
BRANCH="boring/release-$(date +%Y%m%d%H%M%S)"
|
||||
|
||||
git fetch
|
||||
git worktree add --track -b "$BRANCH" "$WORKTREE" origin/dev.boringcrypto
|
||||
|
||||
cd "$WORKTREE/src"
|
||||
GOEXPERIMENT=boringcrypto ./make.bash
|
||||
|
||||
cd ../misc/boring
|
||||
for branch in "$@"; do
|
||||
./build.release "origin/$branch"
|
||||
./build.docker
|
||||
done
|
||||
|
||||
git add RELEASES
|
||||
git commit -m "misc/boring: add new releases to RELEASES file"
|
||||
git codereview mail
|
||||
|
||||
rm *.tar.gz
|
||||
cd - && git worktree remove "$WORKTREE"
|
||||
@@ -112,7 +112,6 @@ func TestReportsTypeErrors(t *testing.T) {
|
||||
"issue18889.go",
|
||||
"issue28721.go",
|
||||
"issue33061.go",
|
||||
"issue50710.go",
|
||||
} {
|
||||
check(t, file)
|
||||
}
|
||||
|
||||
14
misc/cgo/errors/testdata/issue50710.go
vendored
14
misc/cgo/errors/testdata/issue50710.go
vendored
@@ -1,14 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
// size_t StrLen(_GoString_ s) {
|
||||
// return _GoStringLen(s);
|
||||
// }
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
C.StrLen1() // ERROR HERE
|
||||
}
|
||||
@@ -15,14 +15,6 @@ func TestSetgid(t *testing.T) {
|
||||
}
|
||||
testSetgid(t)
|
||||
}
|
||||
|
||||
func TestSetgidStress(t *testing.T) {
|
||||
if runtime.GOOS == "android" {
|
||||
t.Skip("unsupported on Android")
|
||||
}
|
||||
testSetgidStress(t)
|
||||
}
|
||||
|
||||
func Test1435(t *testing.T) { test1435(t) }
|
||||
func Test6997(t *testing.T) { test6997(t) }
|
||||
func TestBuildID(t *testing.T) { testBuildID(t) }
|
||||
|
||||
@@ -10,7 +10,6 @@ package cgotest
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
"syscall"
|
||||
@@ -146,11 +145,6 @@ func test1435(t *testing.T) {
|
||||
if syscall.Getuid() != 0 {
|
||||
t.Skip("skipping root only test")
|
||||
}
|
||||
if runtime.GOOS == "linux" {
|
||||
if _, err := os.Stat("/etc/alpine-release"); err == nil {
|
||||
t.Skip("skipping failing test on alpine - go.dev/issue/19938")
|
||||
}
|
||||
}
|
||||
|
||||
// Launch some threads in C.
|
||||
const cts = 5
|
||||
|
||||
@@ -34,10 +34,6 @@ func TestCrossPackageTests(t *testing.T) {
|
||||
case "arm64":
|
||||
t.Skip("Can't exec cmd/go subprocess on iOS.")
|
||||
}
|
||||
case "linux":
|
||||
if _, err := os.Stat("/etc/alpine-release"); err == nil {
|
||||
t.Skip("skipping failing test on alpine - go.dev/issue/39857")
|
||||
}
|
||||
}
|
||||
|
||||
GOPATH, err := os.MkdirTemp("", "cgotest")
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
// Stress test setgid and thread creation. A thread
|
||||
// can get a SIGSETXID signal early on at thread
|
||||
// initialization, causing crash. See issue 53374.
|
||||
|
||||
package cgotest
|
||||
|
||||
/*
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func testSetgidStress(t *testing.T) {
|
||||
const N = 50
|
||||
ch := make(chan int, N)
|
||||
for i := 0; i < N; i++ {
|
||||
go func() {
|
||||
C.setgid(0)
|
||||
ch <- 1
|
||||
runtime.LockOSThread() // so every goroutine uses a new thread
|
||||
}()
|
||||
}
|
||||
for i := 0; i < N; i++ {
|
||||
<-ch
|
||||
}
|
||||
}
|
||||
13
misc/cgo/test/testdata/issue52611.go
vendored
13
misc/cgo/test/testdata/issue52611.go
vendored
@@ -1,13 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
// Issue 52611: inconsistent compiler behaviour when compiling a C.struct.
|
||||
// No runtime test; just make sure it compiles.
|
||||
|
||||
package cgotest
|
||||
|
||||
import (
|
||||
_ "cgotest/issue52611a"
|
||||
_ "cgotest/issue52611b"
|
||||
)
|
||||
16
misc/cgo/test/testdata/issue52611a/a.go
vendored
16
misc/cgo/test/testdata/issue52611a/a.go
vendored
@@ -1,16 +0,0 @@
|
||||
// Copyright 2022 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 issue52611a
|
||||
|
||||
/*
|
||||
typedef struct Foo {
|
||||
int X;
|
||||
} Foo;
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func GetX1(foo *C.struct_Foo) int32 {
|
||||
return int32(foo.X)
|
||||
}
|
||||
11
misc/cgo/test/testdata/issue52611a/b.go
vendored
11
misc/cgo/test/testdata/issue52611a/b.go
vendored
@@ -1,11 +0,0 @@
|
||||
// Copyright 2022 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 issue52611a
|
||||
|
||||
import "C"
|
||||
|
||||
func GetX2(foo *C.struct_Foo) int32 {
|
||||
return int32(foo.X)
|
||||
}
|
||||
11
misc/cgo/test/testdata/issue52611b/a.go
vendored
11
misc/cgo/test/testdata/issue52611b/a.go
vendored
@@ -1,11 +0,0 @@
|
||||
// Copyright 2022 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 issue52611b
|
||||
|
||||
import "C"
|
||||
|
||||
func GetX1(bar *C.struct_Bar) int32 {
|
||||
return int32(bar.X)
|
||||
}
|
||||
16
misc/cgo/test/testdata/issue52611b/b.go
vendored
16
misc/cgo/test/testdata/issue52611b/b.go
vendored
@@ -1,16 +0,0 @@
|
||||
// Copyright 2022 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 issue52611b
|
||||
|
||||
/*
|
||||
typedef struct Bar {
|
||||
int X;
|
||||
} Bar;
|
||||
*/
|
||||
import "C"
|
||||
|
||||
func GetX2(bar *C.struct_Bar) int32 {
|
||||
return int32(bar.X)
|
||||
}
|
||||
28
misc/cgo/test/testdata/issue9400/asm_loong64.s
vendored
28
misc/cgo/test/testdata/issue9400/asm_loong64.s
vendored
@@ -1,28 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
TEXT ·RewindAndSetgid(SB),NOSPLIT|NOFRAME,$0-0
|
||||
// Rewind stack pointer so anything that happens on the stack
|
||||
// will clobber the test pattern created by the caller
|
||||
ADDV $(1024*8), R3
|
||||
|
||||
// Ask signaller to setgid
|
||||
MOVW $1, R12
|
||||
DBAR
|
||||
MOVW R12, ·Baton(SB)
|
||||
DBAR
|
||||
|
||||
// Wait for setgid completion
|
||||
loop:
|
||||
DBAR
|
||||
MOVW ·Baton(SB), R12
|
||||
OR R13, R13, R13 // hint that we're in a spin loop
|
||||
BNE R12, loop
|
||||
DBAR
|
||||
|
||||
// Restore stack
|
||||
ADDV $(-1024*8), R3
|
||||
RET
|
||||
@@ -46,13 +46,6 @@ func TestMain(m *testing.M) {
|
||||
fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
if runtime.GOOS == "linux" {
|
||||
if _, err := os.Stat("/etc/alpine-release"); err == nil {
|
||||
fmt.Printf("SKIP - skipping failing test on alpine - go.dev/issue/19938\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
log.SetFlags(log.Lshortfile)
|
||||
os.Exit(testMain(m))
|
||||
}
|
||||
@@ -212,7 +205,6 @@ func genHeader(t *testing.T, header, dir string) {
|
||||
func testInstall(t *testing.T, exe, libgoa, libgoh string, buildcmd ...string) {
|
||||
t.Helper()
|
||||
cmd := exec.Command(buildcmd[0], buildcmd[1:]...)
|
||||
cmd.Env = append(cmd.Environ(), "GO111MODULE=off") // 'go install' only works in GOPATH mode
|
||||
t.Log(buildcmd)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Logf("%s", out)
|
||||
@@ -246,7 +238,7 @@ func testInstall(t *testing.T, exe, libgoa, libgoh string, buildcmd ...string) {
|
||||
binArgs := append(cmdToRun(exe), "arg1", "arg2")
|
||||
cmd = exec.Command(binArgs[0], binArgs[1:]...)
|
||||
if runtime.Compiler == "gccgo" {
|
||||
cmd.Env = append(cmd.Environ(), "GCCGO=1")
|
||||
cmd.Env = append(os.Environ(), "GCCGO=1")
|
||||
}
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Logf("%s", out)
|
||||
@@ -830,15 +822,9 @@ func TestPIE(t *testing.T) {
|
||||
t.Skipf("skipping PIE test on %s", GOOS)
|
||||
}
|
||||
|
||||
libgoa := "libgo.a"
|
||||
if runtime.Compiler == "gccgo" {
|
||||
libgoa = "liblibgo.a"
|
||||
}
|
||||
|
||||
if !testWork {
|
||||
defer func() {
|
||||
os.Remove("testp" + exeSuffix)
|
||||
os.Remove(libgoa)
|
||||
os.RemoveAll(filepath.Join(GOPATH, "pkg"))
|
||||
}()
|
||||
}
|
||||
@@ -851,13 +837,18 @@ func TestPIE(t *testing.T) {
|
||||
// be running this test in a GOROOT owned by root.)
|
||||
genHeader(t, "p.h", "./p")
|
||||
|
||||
cmd := exec.Command("go", "build", "-buildmode=c-archive", "./libgo")
|
||||
cmd := exec.Command("go", "install", "-buildmode=c-archive", "./libgo")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Logf("%s", out)
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ccArgs := append(cc, "-fPIE", "-pie", "-o", "testp"+exeSuffix, "main.c", "main_unix.c", libgoa)
|
||||
libgoa := "libgo.a"
|
||||
if runtime.Compiler == "gccgo" {
|
||||
libgoa = "liblibgo.a"
|
||||
}
|
||||
|
||||
ccArgs := append(cc, "-fPIE", "-pie", "-o", "testp"+exeSuffix, "main.c", "main_unix.c", filepath.Join(libgodir, libgoa))
|
||||
if runtime.Compiler == "gccgo" {
|
||||
ccArgs = append(ccArgs, "-lgo")
|
||||
}
|
||||
@@ -1044,7 +1035,6 @@ func TestCachedInstall(t *testing.T) {
|
||||
buildcmd := []string{"go", "install", "-buildmode=c-archive", "./libgo"}
|
||||
|
||||
cmd := exec.Command(buildcmd[0], buildcmd[1:]...)
|
||||
cmd.Env = append(cmd.Environ(), "GO111MODULE=off") // 'go install' only works in GOPATH mode
|
||||
t.Log(buildcmd)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Logf("%s", out)
|
||||
@@ -1060,7 +1050,6 @@ func TestCachedInstall(t *testing.T) {
|
||||
}
|
||||
|
||||
cmd = exec.Command(buildcmd[0], buildcmd[1:]...)
|
||||
cmd.Env = append(cmd.Environ(), "GO111MODULE=off")
|
||||
t.Log(buildcmd)
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
t.Logf("%s", out)
|
||||
|
||||
@@ -44,12 +44,6 @@ func testMain(m *testing.M) int {
|
||||
fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
if runtime.GOOS == "linux" {
|
||||
if _, err := os.Stat("/etc/alpine-release"); err == nil {
|
||||
fmt.Printf("SKIP - skipping failing test on alpine - go.dev/issue/19938\n")
|
||||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
GOOS = goEnv("GOOS")
|
||||
GOARCH = goEnv("GOARCH")
|
||||
@@ -157,22 +151,16 @@ func testMain(m *testing.M) int {
|
||||
// The installation directory format varies depending on the platform.
|
||||
output, err := exec.Command("go", "list",
|
||||
"-buildmode=c-shared",
|
||||
"-installsuffix", "testcshared",
|
||||
"-f", "{{.Target}}",
|
||||
"runtime/cgo").CombinedOutput()
|
||||
"./libgo").CombinedOutput()
|
||||
if err != nil {
|
||||
log.Panicf("go list failed: %v\n%s", err, output)
|
||||
}
|
||||
runtimeCgoTarget := string(bytes.TrimSpace(output))
|
||||
libSuffix = strings.TrimPrefix(filepath.Ext(runtimeCgoTarget), ".")
|
||||
|
||||
defer func() {
|
||||
if installdir != "" {
|
||||
err := os.RemoveAll(installdir)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
target := string(bytes.TrimSpace(output))
|
||||
libgoname = filepath.Base(target)
|
||||
installdir = filepath.Dir(target)
|
||||
libSuffix = strings.TrimPrefix(filepath.Ext(target), ".")
|
||||
|
||||
return m.Run()
|
||||
}
|
||||
@@ -296,13 +284,8 @@ func createHeaders() error {
|
||||
}
|
||||
|
||||
// Generate a C header file for libgo itself.
|
||||
installdir, err = os.MkdirTemp("", "testcshared")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
libgoname = "libgo." + libSuffix
|
||||
|
||||
args = []string{"go", "build", "-buildmode=c-shared", "-o", filepath.Join(installdir, libgoname), "./libgo"}
|
||||
args = []string{"go", "install", "-buildmode=c-shared",
|
||||
"-installsuffix", "testcshared", "./libgo"}
|
||||
cmd = exec.Command(args[0], args[1:]...)
|
||||
out, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
@@ -390,7 +373,6 @@ func createHeadersOnce(t *testing.T) {
|
||||
headersErr = createHeaders()
|
||||
})
|
||||
if headersErr != nil {
|
||||
t.Helper()
|
||||
t.Fatal(headersErr)
|
||||
}
|
||||
}
|
||||
@@ -723,15 +705,12 @@ func TestCachedInstall(t *testing.T) {
|
||||
copyFile(t, filepath.Join(tmpdir, "src", "testcshared", "libgo", "libgo.go"), filepath.Join("libgo", "libgo.go"))
|
||||
copyFile(t, filepath.Join(tmpdir, "src", "testcshared", "p", "p.go"), filepath.Join("p", "p.go"))
|
||||
|
||||
env := append(os.Environ(), "GOPATH="+tmpdir, "GOBIN="+filepath.Join(tmpdir, "bin"))
|
||||
|
||||
buildcmd := []string{"go", "install", "-x", "-buildmode=c-shared", "-installsuffix", "testcshared", "./libgo"}
|
||||
|
||||
cmd := exec.Command(buildcmd[0], buildcmd[1:]...)
|
||||
cmd.Dir = filepath.Join(tmpdir, "src", "testcshared")
|
||||
env := append(cmd.Environ(),
|
||||
"GOPATH="+tmpdir,
|
||||
"GOBIN="+filepath.Join(tmpdir, "bin"),
|
||||
"GO111MODULE=off", // 'go install' only works in GOPATH mode
|
||||
)
|
||||
cmd.Env = env
|
||||
t.Log(buildcmd)
|
||||
out, err := cmd.CombinedOutput()
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
)
|
||||
|
||||
var gcflags string = os.Getenv("GO_GCFLAGS")
|
||||
var goroot string
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
flag.Parse()
|
||||
@@ -44,12 +43,6 @@ func prettyPrintf(format string, args ...interface{}) {
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
goroot = filepath.Join(cwd, "../../..")
|
||||
|
||||
// Copy testdata into GOPATH/src/testplugin, along with a go.mod file
|
||||
// declaring the same path.
|
||||
|
||||
@@ -120,7 +113,7 @@ func goCmd(t *testing.T, op string, args ...string) {
|
||||
if t != nil {
|
||||
t.Helper()
|
||||
}
|
||||
run(t, filepath.Join(goroot, "bin", "go"), append([]string{op, "-gcflags", gcflags}, args...)...)
|
||||
run(t, "go", append([]string{op, "-gcflags", gcflags}, args...)...)
|
||||
}
|
||||
|
||||
// escape converts a string to something suitable for a shell command line.
|
||||
@@ -218,7 +211,7 @@ func TestIssue18676(t *testing.T) {
|
||||
|
||||
func TestIssue19534(t *testing.T) {
|
||||
// Test that we can load a plugin built in a path with non-alpha characters.
|
||||
goCmd(t, "build", "-buildmode=plugin", "-gcflags=-p=issue.19534", "-ldflags=-pluginpath=issue.19534", "-o", "plugin.so", "./issue19534/plugin.go")
|
||||
goCmd(t, "build", "-buildmode=plugin", "-ldflags='-pluginpath=issue.19534'", "-o", "plugin.so", "./issue19534/plugin.go")
|
||||
goCmd(t, "build", "-o", "issue19534.exe", "./issue19534/main.go")
|
||||
run(t, "./issue19534.exe")
|
||||
}
|
||||
@@ -303,16 +296,6 @@ func TestIssue44956(t *testing.T) {
|
||||
run(t, "./issue44956.exe")
|
||||
}
|
||||
|
||||
func TestIssue52937(t *testing.T) {
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "issue52937.so", "./issue52937/main.go")
|
||||
}
|
||||
|
||||
func TestIssue53989(t *testing.T) {
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "issue53989.so", "./issue53989/plugin.go")
|
||||
goCmd(t, "build", "-o", "issue53989.exe", "./issue53989/main.go")
|
||||
run(t, "./issue53989.exe")
|
||||
}
|
||||
|
||||
func TestForkExec(t *testing.T) {
|
||||
// Issue 38824: importing the plugin package causes it hang in forkExec on darwin.
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
func main() {}
|
||||
func F[T any]() {}
|
||||
func G[T any](T) {}
|
||||
32
misc/cgo/testplugin/testdata/issue53989/main.go
vendored
32
misc/cgo/testplugin/testdata/issue53989/main.go
vendored
@@ -1,32 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
// Issue 53989: the use of jump table caused a function
|
||||
// from the plugin jumps in the middle of the function
|
||||
// to the function with the same name in the main
|
||||
// executable. As these two functions may be compiled
|
||||
// differently as plugin needs to be PIC, this causes
|
||||
// crash.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"plugin"
|
||||
|
||||
"testplugin/issue53989/p"
|
||||
)
|
||||
|
||||
func main() {
|
||||
p.Square(7) // call the function in main executable
|
||||
|
||||
p, err := plugin.Open("issue53989.so")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
f, err := p.Lookup("Square")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
f.(func(int))(7) // call the plugin one
|
||||
}
|
||||
52
misc/cgo/testplugin/testdata/issue53989/p/p.go
vendored
52
misc/cgo/testplugin/testdata/issue53989/p/p.go
vendored
@@ -1,52 +0,0 @@
|
||||
// Copyright 2022 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 p
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var y int
|
||||
|
||||
//go:noinline
|
||||
func Square(x int) {
|
||||
var pc0, pc1 [1]uintptr
|
||||
runtime.Callers(1, pc0[:]) // get PC at entry
|
||||
|
||||
// a switch using jump table
|
||||
switch x {
|
||||
case 1:
|
||||
y = 1
|
||||
case 2:
|
||||
y = 4
|
||||
case 3:
|
||||
y = 9
|
||||
case 4:
|
||||
y = 16
|
||||
case 5:
|
||||
y = 25
|
||||
case 6:
|
||||
y = 36
|
||||
case 7:
|
||||
y = 49
|
||||
case 8:
|
||||
y = 64
|
||||
default:
|
||||
panic("too large")
|
||||
}
|
||||
|
||||
// check PC is in the same function
|
||||
runtime.Callers(1, pc1[:])
|
||||
if pc1[0] < pc0[0] || pc1[0] > pc0[0]+1000000 {
|
||||
fmt.Printf("jump across DSO boundary. pc0=%x, pc1=%x\n", pc0[0], pc1[0])
|
||||
panic("FAIL")
|
||||
}
|
||||
|
||||
if y != x*x {
|
||||
fmt.Printf("x=%d y=%d!=%d\n", x, y, x*x)
|
||||
panic("FAIL")
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
import "testplugin/issue53989/p"
|
||||
|
||||
func Square(x int) { // export Square for plugin
|
||||
p.Square(x)
|
||||
}
|
||||
|
||||
func main() {}
|
||||
@@ -22,14 +22,6 @@ func TestASAN(t *testing.T) {
|
||||
if !aSanSupported(goos, goarch) {
|
||||
t.Skipf("skipping on %s/%s; -asan option is not supported.", goos, goarch)
|
||||
}
|
||||
// The current implementation is only compatible with the ASan library from version
|
||||
// v7 to v9 (See the description in src/runtime/asan/asan.go). Therefore, using the
|
||||
// -asan option must use a compatible version of ASan library, which requires that
|
||||
// the gcc version is not less than 7 and the clang version is not less than 9,
|
||||
// otherwise a segmentation fault will occur.
|
||||
if !compilerRequiredAsanVersion() {
|
||||
t.Skipf("skipping: too old version of compiler")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
requireOvercommit(t)
|
||||
@@ -52,11 +44,6 @@ func TestASAN(t *testing.T) {
|
||||
{src: "asan_unsafe_fail1.go", memoryAccessError: "use-after-poison", errorLocation: "asan_unsafe_fail1.go:25"},
|
||||
{src: "asan_unsafe_fail2.go", memoryAccessError: "use-after-poison", errorLocation: "asan_unsafe_fail2.go:25"},
|
||||
{src: "asan_unsafe_fail3.go", memoryAccessError: "use-after-poison", errorLocation: "asan_unsafe_fail3.go:18"},
|
||||
{src: "asan_global1_fail.go", memoryAccessError: "global-buffer-overflow", errorLocation: "asan_global1_fail.go:12"},
|
||||
{src: "asan_global2_fail.go", memoryAccessError: "global-buffer-overflow", errorLocation: "asan_global2_fail.go:19"},
|
||||
{src: "asan_global3_fail.go", memoryAccessError: "global-buffer-overflow", errorLocation: "asan_global3_fail.go:13"},
|
||||
{src: "asan_global4_fail.go", memoryAccessError: "global-buffer-overflow", errorLocation: "asan_global4_fail.go:21"},
|
||||
{src: "asan_global5.go"},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
tc := tc
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
"unicode"
|
||||
)
|
||||
|
||||
@@ -91,26 +90,9 @@ func replaceEnv(cmd *exec.Cmd, key, value string) {
|
||||
// mustRun executes t and fails cmd with a well-formatted message if it fails.
|
||||
func mustRun(t *testing.T, cmd *exec.Cmd) {
|
||||
t.Helper()
|
||||
out := new(strings.Builder)
|
||||
cmd.Stdout = out
|
||||
cmd.Stderr = out
|
||||
|
||||
err := cmd.Start()
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("%v: %v", cmd, err)
|
||||
}
|
||||
|
||||
if deadline, ok := t.Deadline(); ok {
|
||||
timeout := time.Until(deadline)
|
||||
timeout -= timeout / 10 // Leave 10% headroom for logging and cleanup.
|
||||
timer := time.AfterFunc(timeout, func() {
|
||||
cmd.Process.Signal(syscall.SIGQUIT)
|
||||
})
|
||||
defer timer.Stop()
|
||||
}
|
||||
|
||||
if err := cmd.Wait(); err != nil {
|
||||
t.Fatalf("%v exited with %v\n%s", cmd, err, out)
|
||||
t.Fatalf("%#q exited with %v\n%s", strings.Join(cmd.Args, " "), err, out)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,16 +184,17 @@ func compilerVersion() (version, error) {
|
||||
var match [][]byte
|
||||
if bytes.HasPrefix(out, []byte("gcc")) {
|
||||
compiler.name = "gcc"
|
||||
cmd, err := cc("-v")
|
||||
|
||||
cmd, err := cc("-dumpversion")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out, err := cmd.CombinedOutput()
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
// gcc, but does not support gcc's "-v" flag?!
|
||||
// gcc, but does not support gcc's "-dumpversion" flag?!
|
||||
return err
|
||||
}
|
||||
gccRE := regexp.MustCompile(`gcc version (\d+)\.(\d+)`)
|
||||
gccRE := regexp.MustCompile(`(\d+)\.(\d+)`)
|
||||
match = gccRE.FindSubmatch(out)
|
||||
} else {
|
||||
clangRE := regexp.MustCompile(`clang version (\d+)\.(\d+)`)
|
||||
@@ -252,22 +235,6 @@ func compilerSupportsLocation() bool {
|
||||
}
|
||||
}
|
||||
|
||||
// compilerRequiredAsanVersion reports whether the compiler is the version required by Asan.
|
||||
func compilerRequiredAsanVersion() bool {
|
||||
compiler, err := compilerVersion()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
switch compiler.name {
|
||||
case "gcc":
|
||||
return compiler.major >= 7
|
||||
case "clang":
|
||||
return compiler.major >= 9
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
type compilerCheck struct {
|
||||
once sync.Once
|
||||
err error
|
||||
@@ -511,7 +478,7 @@ func mSanSupported(goos, goarch string) bool {
|
||||
func aSanSupported(goos, goarch string) bool {
|
||||
switch goos {
|
||||
case "linux":
|
||||
return goarch == "amd64" || goarch == "arm64" || goarch == "riscv64"
|
||||
return goarch == "amd64" || goarch == "arm64"
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int test(int *a) {
|
||||
a[2] = 300; // BOOM
|
||||
return a[2];
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import "fmt"
|
||||
|
||||
var cIntArray [2]C.int
|
||||
|
||||
func main() {
|
||||
r := C.test(&cIntArray[0])
|
||||
fmt.Println("r value = ", r)
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct ss {
|
||||
int *p;
|
||||
int len;
|
||||
int cap;
|
||||
};
|
||||
|
||||
int test(struct ss *a) {
|
||||
struct ss *t = a + 1;
|
||||
t->len = 100; // BOOM
|
||||
return t->len;
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
import "fmt"
|
||||
|
||||
var tt C.struct_ss
|
||||
|
||||
func main() {
|
||||
r := C.test(&tt)
|
||||
fmt.Println("r value = ", r)
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
/*
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int test(int *a) {
|
||||
int* p = a+1;
|
||||
*p = 10; // BOOM
|
||||
return *p;
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var cIntV C.int
|
||||
|
||||
func main() {
|
||||
r := C.test((*C.int)(unsafe.Pointer(&cIntV)))
|
||||
fmt.Printf("r value is %d", r)
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var intGlo int
|
||||
|
||||
func main() {
|
||||
r := bar(&intGlo)
|
||||
fmt.Printf("r value is %d", r)
|
||||
}
|
||||
|
||||
func bar(a *int) int {
|
||||
p := (*int)(unsafe.Add(unsafe.Pointer(a), 1*unsafe.Sizeof(int(1))))
|
||||
if *p == 10 { // BOOM
|
||||
fmt.Println("its value is 10")
|
||||
}
|
||||
return *p
|
||||
}
|
||||
22
misc/cgo/testsanitizers/testdata/asan_global5.go
vendored
22
misc/cgo/testsanitizers/testdata/asan_global5.go
vendored
@@ -1,22 +0,0 @@
|
||||
// Copyright 2022 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 main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Any struct {
|
||||
s string
|
||||
b int64
|
||||
}
|
||||
|
||||
var Sg = []interface{}{
|
||||
Any{"a", 10},
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println(Sg[0])
|
||||
}
|
||||
2
misc/cgo/testsanitizers/testdata/tsan11.go
vendored
2
misc/cgo/testsanitizers/testdata/tsan11.go
vendored
@@ -45,7 +45,7 @@ static void register_handler(int signo) {
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
ch := make(chan os.Signal, 1)
|
||||
ch := make(chan os.Signal)
|
||||
signal.Notify(ch, syscall.SIGUSR2)
|
||||
|
||||
C.register_handler(C.int(syscall.SIGUSR1))
|
||||
|
||||
2
misc/cgo/testsanitizers/testdata/tsan12.go
vendored
2
misc/cgo/testsanitizers/testdata/tsan12.go
vendored
@@ -22,7 +22,7 @@ import (
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
ch := make(chan os.Signal, 1)
|
||||
ch := make(chan os.Signal)
|
||||
signal.Notify(ch, syscall.SIGUSR1)
|
||||
|
||||
if err := exec.Command("true").Run(); err != nil {
|
||||
|
||||
@@ -27,7 +27,6 @@ import (
|
||||
)
|
||||
|
||||
var gopathInstallDir, gorootInstallDir string
|
||||
var oldGOROOT string
|
||||
|
||||
// This is the smallest set of packages we can link into a shared
|
||||
// library (runtime/cgo is built implicitly).
|
||||
@@ -61,7 +60,7 @@ func goCmd(t *testing.T, args ...string) string {
|
||||
newargs = append(newargs, "-x", "-ldflags=-v")
|
||||
}
|
||||
newargs = append(newargs, args[1:]...)
|
||||
c := exec.Command(filepath.Join(oldGOROOT, "bin", "go"), newargs...)
|
||||
c := exec.Command("go", newargs...)
|
||||
stderr := new(strings.Builder)
|
||||
c.Stderr = stderr
|
||||
|
||||
@@ -91,12 +90,6 @@ func goCmd(t *testing.T, args ...string) string {
|
||||
|
||||
// TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit).
|
||||
func testMain(m *testing.M) (int, error) {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
oldGOROOT = filepath.Join(cwd, "../../..")
|
||||
|
||||
workDir, err := os.MkdirTemp("", "shared_test")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -108,15 +101,6 @@ func testMain(m *testing.M) (int, error) {
|
||||
defer os.RemoveAll(workDir)
|
||||
}
|
||||
|
||||
// -buildmode=shared fundamentally does not work in module mode.
|
||||
// (It tries to share package dependencies across builds, but in module mode
|
||||
// each module has its own distinct set of dependency versions.)
|
||||
// We would like to eliminate it (see https://go.dev/issue/47788),
|
||||
// but first need to figure out a replacement that covers the small subset
|
||||
// of use-cases where -buildmode=shared still works today.
|
||||
// For now, run the tests in GOPATH mode only.
|
||||
os.Setenv("GO111MODULE", "off")
|
||||
|
||||
// Some tests need to edit the source in GOPATH, so copy this directory to a
|
||||
// temporary directory and chdir to that.
|
||||
gopath := filepath.Join(workDir, "gopath")
|
||||
@@ -203,6 +187,11 @@ func cloneTestdataModule(gopath string) (string, error) {
|
||||
// GOROOT/pkg relevant to this test into the given directory.
|
||||
// It must be run from within the testdata module.
|
||||
func cloneGOROOTDeps(goroot string) error {
|
||||
oldGOROOT := strings.TrimSpace(goCmd(nil, "env", "GOROOT"))
|
||||
if oldGOROOT == "" {
|
||||
return fmt.Errorf("go env GOROOT returned an empty string")
|
||||
}
|
||||
|
||||
// Before we clone GOROOT, figure out which packages we need to copy over.
|
||||
listArgs := []string{
|
||||
"list",
|
||||
|
||||
@@ -13,9 +13,9 @@ goto end
|
||||
:ok
|
||||
|
||||
set OLDPATH=%PATH%
|
||||
call .\make.bat --no-banner --no-local
|
||||
call make.bat --no-banner --no-local
|
||||
if %GOBUILDFAIL%==1 goto end
|
||||
call .\run.bat --no-rebuild --no-local
|
||||
call run.bat --no-rebuild --no-local
|
||||
if %GOBUILDFAIL%==1 goto end
|
||||
:: we must restore %PATH% before running "dist banner" so that the latter
|
||||
:: can get the original %PATH% and give suggestion to add %GOROOT%/bin
|
||||
|
||||
@@ -33,10 +33,6 @@ type Reader struct {
|
||||
Comment string
|
||||
decompressors map[uint16]Decompressor
|
||||
|
||||
// Some JAR files are zip files with a prefix that is a bash script.
|
||||
// The baseOffset field is the start of the zip file proper.
|
||||
baseOffset int64
|
||||
|
||||
// fileList is a list of files sorted by ename,
|
||||
// for use by the Open method.
|
||||
fileListOnce sync.Once
|
||||
@@ -56,8 +52,9 @@ type File struct {
|
||||
FileHeader
|
||||
zip *Reader
|
||||
zipr io.ReaderAt
|
||||
headerOffset int64 // includes overall ZIP archive baseOffset
|
||||
headerOffset int64
|
||||
zip64 bool // zip64 extended information extra field presence
|
||||
descErr error // error reading the data descriptor during init
|
||||
}
|
||||
|
||||
// OpenReader will open the Zip file specified by name and return a ReadCloser.
|
||||
@@ -94,12 +91,11 @@ func NewReader(r io.ReaderAt, size int64) (*Reader, error) {
|
||||
}
|
||||
|
||||
func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
end, baseOffset, err := readDirectoryEnd(r, size)
|
||||
end, err := readDirectoryEnd(r, size)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
z.r = r
|
||||
z.baseOffset = baseOffset
|
||||
// Since the number of directory records is not validated, it is not
|
||||
// safe to preallocate z.File without first checking that the specified
|
||||
// number of files is reasonable, since a malformed archive may
|
||||
@@ -111,7 +107,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
}
|
||||
z.Comment = end.comment
|
||||
rs := io.NewSectionReader(r, 0, size)
|
||||
if _, err = rs.Seek(z.baseOffset+int64(end.directoryOffset), io.SeekStart); err != nil {
|
||||
if _, err = rs.Seek(int64(end.directoryOffset), io.SeekStart); err != nil {
|
||||
return err
|
||||
}
|
||||
buf := bufio.NewReader(rs)
|
||||
@@ -123,27 +119,12 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
for {
|
||||
f := &File{zip: z, zipr: r}
|
||||
err = readDirectoryHeader(f, buf)
|
||||
|
||||
// For compatibility with other zip programs,
|
||||
// if we have a non-zero base offset and can't read
|
||||
// the first directory header, try again with a zero
|
||||
// base offset.
|
||||
if err == ErrFormat && z.baseOffset != 0 && len(z.File) == 0 {
|
||||
z.baseOffset = 0
|
||||
if _, err = rs.Seek(int64(end.directoryOffset), io.SeekStart); err != nil {
|
||||
return err
|
||||
}
|
||||
buf.Reset(rs)
|
||||
continue
|
||||
}
|
||||
|
||||
if err == ErrFormat || err == io.ErrUnexpectedEOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f.headerOffset += z.baseOffset
|
||||
z.File = append(z.File, f)
|
||||
}
|
||||
if uint16(len(z.File)) != uint16(end.directoryRecords) { // only compare 16 bits here
|
||||
@@ -514,7 +495,7 @@ func readDataDescriptor(r io.Reader, f *File) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, baseOffset int64, err error) {
|
||||
func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) {
|
||||
// look for directoryEndSignature in the last 1k, then in the last 65k
|
||||
var buf []byte
|
||||
var directoryEndOffset int64
|
||||
@@ -524,7 +505,7 @@ func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, baseOffset
|
||||
}
|
||||
buf = make([]byte, int(bLen))
|
||||
if _, err := r.ReadAt(buf, size-bLen); err != nil && err != io.EOF {
|
||||
return nil, 0, err
|
||||
return nil, err
|
||||
}
|
||||
if p := findSignatureInBlock(buf); p >= 0 {
|
||||
buf = buf[p:]
|
||||
@@ -532,7 +513,7 @@ func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, baseOffset
|
||||
break
|
||||
}
|
||||
if i == 1 || bLen == size {
|
||||
return nil, 0, ErrFormat
|
||||
return nil, ErrFormat
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +530,7 @@ func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, baseOffset
|
||||
}
|
||||
l := int(d.commentLen)
|
||||
if l > len(b) {
|
||||
return nil, 0, errors.New("zip: invalid comment length")
|
||||
return nil, errors.New("zip: invalid comment length")
|
||||
}
|
||||
d.comment = string(b[:l])
|
||||
|
||||
@@ -557,21 +538,17 @@ func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, baseOffset
|
||||
if d.directoryRecords == 0xffff || d.directorySize == 0xffff || d.directoryOffset == 0xffffffff {
|
||||
p, err := findDirectory64End(r, directoryEndOffset)
|
||||
if err == nil && p >= 0 {
|
||||
directoryEndOffset = p
|
||||
err = readDirectory64End(r, p, d)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
baseOffset = directoryEndOffset - int64(d.directorySize) - int64(d.directoryOffset)
|
||||
|
||||
// Make sure directoryOffset points to somewhere in our file.
|
||||
if o := baseOffset + int64(d.directoryOffset); o < 0 || o >= size {
|
||||
return nil, 0, ErrFormat
|
||||
if o := int64(d.directoryOffset); o < 0 || o >= size {
|
||||
return nil, ErrFormat
|
||||
}
|
||||
return d, baseOffset, nil
|
||||
return d, nil
|
||||
}
|
||||
|
||||
// findDirectory64End tries to read the zip64 locator just before the
|
||||
@@ -676,7 +653,6 @@ type fileListEntry struct {
|
||||
name string
|
||||
file *File
|
||||
isDir bool
|
||||
isDup bool
|
||||
}
|
||||
|
||||
type fileInfoDirEntry interface {
|
||||
@@ -684,14 +660,11 @@ type fileInfoDirEntry interface {
|
||||
fs.DirEntry
|
||||
}
|
||||
|
||||
func (e *fileListEntry) stat() (fileInfoDirEntry, error) {
|
||||
if e.isDup {
|
||||
return nil, errors.New(e.name + ": duplicate entries in zip file")
|
||||
}
|
||||
func (e *fileListEntry) stat() fileInfoDirEntry {
|
||||
if !e.isDir {
|
||||
return headerFileInfo{&e.file.FileHeader}, nil
|
||||
return headerFileInfo{&e.file.FileHeader}
|
||||
}
|
||||
return e, nil
|
||||
return e
|
||||
}
|
||||
|
||||
// Only used for directories.
|
||||
@@ -726,37 +699,17 @@ func toValidName(name string) string {
|
||||
|
||||
func (r *Reader) initFileList() {
|
||||
r.fileListOnce.Do(func() {
|
||||
// files and knownDirs map from a file/directory name
|
||||
// to an index into the r.fileList entry that we are
|
||||
// building. They are used to mark duplicate entries.
|
||||
files := make(map[string]int)
|
||||
knownDirs := make(map[string]int)
|
||||
|
||||
// dirs[name] is true if name is known to be a directory,
|
||||
// because it appears as a prefix in a path.
|
||||
dirs := make(map[string]bool)
|
||||
|
||||
knownDirs := make(map[string]bool)
|
||||
for _, file := range r.File {
|
||||
isDir := len(file.Name) > 0 && file.Name[len(file.Name)-1] == '/'
|
||||
name := toValidName(file.Name)
|
||||
if name == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
if idx, ok := files[name]; ok {
|
||||
r.fileList[idx].isDup = true
|
||||
continue
|
||||
}
|
||||
if idx, ok := knownDirs[name]; ok {
|
||||
r.fileList[idx].isDup = true
|
||||
continue
|
||||
}
|
||||
|
||||
for dir := path.Dir(name); dir != "."; dir = path.Dir(dir) {
|
||||
dirs[dir] = true
|
||||
}
|
||||
|
||||
idx := len(r.fileList)
|
||||
entry := fileListEntry{
|
||||
name: name,
|
||||
file: file,
|
||||
@@ -764,23 +717,17 @@ func (r *Reader) initFileList() {
|
||||
}
|
||||
r.fileList = append(r.fileList, entry)
|
||||
if isDir {
|
||||
knownDirs[name] = idx
|
||||
} else {
|
||||
files[name] = idx
|
||||
knownDirs[name] = true
|
||||
}
|
||||
}
|
||||
for dir := range dirs {
|
||||
if _, ok := knownDirs[dir]; !ok {
|
||||
if idx, ok := files[dir]; ok {
|
||||
r.fileList[idx].isDup = true
|
||||
} else {
|
||||
entry := fileListEntry{
|
||||
name: dir,
|
||||
file: nil,
|
||||
isDir: true,
|
||||
}
|
||||
r.fileList = append(r.fileList, entry)
|
||||
if !knownDirs[dir] {
|
||||
entry := fileListEntry{
|
||||
name: dir,
|
||||
file: nil,
|
||||
isDir: true,
|
||||
}
|
||||
r.fileList = append(r.fileList, entry)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,7 +822,7 @@ type openDir struct {
|
||||
}
|
||||
|
||||
func (d *openDir) Close() error { return nil }
|
||||
func (d *openDir) Stat() (fs.FileInfo, error) { return d.e.stat() }
|
||||
func (d *openDir) Stat() (fs.FileInfo, error) { return d.e.stat(), nil }
|
||||
|
||||
func (d *openDir) Read([]byte) (int, error) {
|
||||
return 0, &fs.PathError{Op: "read", Path: d.e.name, Err: errors.New("is a directory")}
|
||||
@@ -894,11 +841,7 @@ func (d *openDir) ReadDir(count int) ([]fs.DirEntry, error) {
|
||||
}
|
||||
list := make([]fs.DirEntry, n)
|
||||
for i := range list {
|
||||
s, err := d.files[d.offset+i].stat()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
list[i] = s
|
||||
list[i] = d.files[d.offset+i].stat()
|
||||
}
|
||||
d.offset += n
|
||||
return list, nil
|
||||
|
||||
@@ -90,42 +90,6 @@ var tests = []ZipTest{
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "test-prefix.zip",
|
||||
Comment: "This is a zipfile comment.",
|
||||
File: []ZipTestFile{
|
||||
{
|
||||
Name: "test.txt",
|
||||
Content: []byte("This is a test text file.\n"),
|
||||
Modified: time.Date(2010, 9, 5, 12, 12, 1, 0, timeZone(+10*time.Hour)),
|
||||
Mode: 0644,
|
||||
},
|
||||
{
|
||||
Name: "gophercolor16x16.png",
|
||||
File: "gophercolor16x16.png",
|
||||
Modified: time.Date(2010, 9, 5, 15, 52, 58, 0, timeZone(+10*time.Hour)),
|
||||
Mode: 0644,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "test-baddirsz.zip",
|
||||
Comment: "This is a zipfile comment.",
|
||||
File: []ZipTestFile{
|
||||
{
|
||||
Name: "test.txt",
|
||||
Content: []byte("This is a test text file.\n"),
|
||||
Modified: time.Date(2010, 9, 5, 12, 12, 1, 0, timeZone(+10*time.Hour)),
|
||||
Mode: 0644,
|
||||
},
|
||||
{
|
||||
Name: "gophercolor16x16.png",
|
||||
File: "gophercolor16x16.png",
|
||||
Modified: time.Date(2010, 9, 5, 15, 52, 58, 0, timeZone(+10*time.Hour)),
|
||||
Mode: 0644,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "r.zip",
|
||||
Source: returnRecursiveZip,
|
||||
@@ -523,35 +487,6 @@ var tests = []ZipTest{
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "dupdir.zip",
|
||||
File: []ZipTestFile{
|
||||
{
|
||||
Name: "a/",
|
||||
Content: []byte{},
|
||||
Mode: fs.ModeDir | 0666,
|
||||
Modified: time.Date(2021, 12, 29, 0, 0, 0, 0, timeZone(0)),
|
||||
},
|
||||
{
|
||||
Name: "a/b",
|
||||
Content: []byte{},
|
||||
Mode: 0666,
|
||||
Modified: time.Date(2021, 12, 29, 0, 0, 0, 0, timeZone(0)),
|
||||
},
|
||||
{
|
||||
Name: "a/b/",
|
||||
Content: []byte{},
|
||||
Mode: fs.ModeDir | 0666,
|
||||
Modified: time.Date(2021, 12, 29, 0, 0, 0, 0, timeZone(0)),
|
||||
},
|
||||
{
|
||||
Name: "a/b/c",
|
||||
Content: []byte{},
|
||||
Mode: 0666,
|
||||
Modified: time.Date(2021, 12, 29, 0, 0, 0, 0, timeZone(0)),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestReader(t *testing.T) {
|
||||
@@ -1076,7 +1011,7 @@ func TestIssue10957(t *testing.T) {
|
||||
"\x00\x00\x00\x00\x0000000000\x00\x00\x00\x00000" +
|
||||
"00000000PK\x01\x0200000000" +
|
||||
"0000000000000000\v\x00\x00\x00" +
|
||||
"\x00\x0000PK\x05\x06000000\x05\x00\xfd\x00\x00\x00" +
|
||||
"\x00\x0000PK\x05\x06000000\x05\x000000" +
|
||||
"\v\x00\x00\x00\x00\x00")
|
||||
z, err := NewReader(bytes.NewReader(data), int64(len(data)))
|
||||
if err != nil {
|
||||
@@ -1121,7 +1056,7 @@ func TestIssue11146(t *testing.T) {
|
||||
"0000000000000000PK\x01\x02" +
|
||||
"0000\b0\b\x00000000000000" +
|
||||
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000000PK\x05\x06\x00\x00" +
|
||||
"\x00\x0000\x01\x00\x26\x00\x00\x008\x00\x00\x00\x00\x00")
|
||||
"\x00\x0000\x01\x0000008\x00\x00\x00\x00\x00")
|
||||
z, err := NewReader(bytes.NewReader(data), int64(len(data)))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -1188,7 +1123,6 @@ func TestFS(t *testing.T) {
|
||||
[]string{"a/b/c"},
|
||||
},
|
||||
} {
|
||||
test := test
|
||||
t.Run(test.file, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
z, err := OpenReader(test.file)
|
||||
@@ -1203,60 +1137,6 @@ func TestFS(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFSWalk(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
file string
|
||||
want []string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
file: "testdata/unix.zip",
|
||||
want: []string{".", "dir", "dir/bar", "dir/empty", "hello", "readonly"},
|
||||
},
|
||||
{
|
||||
file: "testdata/subdir.zip",
|
||||
want: []string{".", "a", "a/b", "a/b/c"},
|
||||
},
|
||||
{
|
||||
file: "testdata/dupdir.zip",
|
||||
wantErr: true,
|
||||
},
|
||||
} {
|
||||
test := test
|
||||
t.Run(test.file, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
z, err := OpenReader(test.file)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var files []string
|
||||
sawErr := false
|
||||
err = fs.WalkDir(z, ".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
if !test.wantErr {
|
||||
t.Errorf("%s: %v", path, err)
|
||||
}
|
||||
sawErr = true
|
||||
return nil
|
||||
}
|
||||
files = append(files, path)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
t.Errorf("fs.WalkDir error: %v", err)
|
||||
}
|
||||
if test.wantErr && !sawErr {
|
||||
t.Error("succeeded but want error")
|
||||
} else if !test.wantErr && sawErr {
|
||||
t.Error("unexpected error")
|
||||
}
|
||||
if test.want != nil && !reflect.DeepEqual(files, test.want) {
|
||||
t.Errorf("got %v want %v", files, test.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestFSModTime(t *testing.T) {
|
||||
t.Parallel()
|
||||
z, err := OpenReader("testdata/subdir.zip")
|
||||
|
||||
BIN
src/archive/zip/testdata/dupdir.zip
vendored
BIN
src/archive/zip/testdata/dupdir.zip
vendored
Binary file not shown.
BIN
src/archive/zip/testdata/readme.notzip
vendored
BIN
src/archive/zip/testdata/readme.notzip
vendored
Binary file not shown.
BIN
src/archive/zip/testdata/test-baddirsz.zip
vendored
BIN
src/archive/zip/testdata/test-baddirsz.zip
vendored
Binary file not shown.
BIN
src/archive/zip/testdata/test-prefix.zip
vendored
BIN
src/archive/zip/testdata/test-prefix.zip
vendored
Binary file not shown.
@@ -203,8 +203,7 @@ func (b *Reader) Discard(n int) (discarded int, err error) {
|
||||
// The bytes are taken from at most one Read on the underlying Reader,
|
||||
// hence n may be less than len(p).
|
||||
// To read exactly len(p) bytes, use io.ReadFull(b, p).
|
||||
// If the underlying Reader can return a non-zero count with io.EOF,
|
||||
// then this Read method can do so as well; see the [io.Reader] docs.
|
||||
// At EOF, the count will be zero and err will be io.EOF.
|
||||
func (b *Reader) Read(p []byte) (n int, err error) {
|
||||
n = len(p)
|
||||
if n == 0 {
|
||||
|
||||
@@ -236,7 +236,7 @@ func imag(c ComplexType) FloatType
|
||||
//
|
||||
// x, ok := <-c
|
||||
//
|
||||
// will also set ok to false for a closed and empty channel.
|
||||
// will also set ok to false for a closed channel.
|
||||
func close(c chan<- Type)
|
||||
|
||||
// The panic built-in function stops normal execution of the current
|
||||
|
||||
@@ -140,36 +140,6 @@ var indexTests = []BinOpTest{
|
||||
{"abc", "c", 2},
|
||||
{"abc", "x", -1},
|
||||
{"barfoobarfooyyyzzzyyyzzzyyyzzzyyyxxxzzzyyy", "x", 33},
|
||||
{"fofofofooofoboo", "oo", 7},
|
||||
{"fofofofofofoboo", "ob", 11},
|
||||
{"fofofofofofoboo", "boo", 12},
|
||||
{"fofofofofofoboo", "oboo", 11},
|
||||
{"fofofofofoooboo", "fooo", 8},
|
||||
{"fofofofofofoboo", "foboo", 10},
|
||||
{"fofofofofofoboo", "fofob", 8},
|
||||
{"fofofofofofofoffofoobarfoo", "foffof", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffof", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofo", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofo", 13},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofoo", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofoo", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofoob", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofoob", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofooba", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofooba", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofoobar", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofoobar", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofoobarf", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofoobarf", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofoobarfo", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofoobarfo", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "foffofoobarfoo", 13},
|
||||
{"fofofofofofofoffofoobarfoo", "foffofoobarfoo", 12},
|
||||
{"fofofofofoofofoffofoobarfoo", "ofoffofoobarfoo", 12},
|
||||
{"fofofofofofofoffofoobarfoo", "ofoffofoobarfoo", 11},
|
||||
{"fofofofofoofofoffofoobarfoo", "fofoffofoobarfoo", 11},
|
||||
{"fofofofofofofoffofoobarfoo", "fofoffofoobarfoo", 10},
|
||||
{"fofofofofoofofoffofoobarfoo", "foobars", -1},
|
||||
{"foofyfoobarfoobar", "y", 4},
|
||||
{"oooooooooooooooooooooo", "r", -1},
|
||||
{"oxoxoxoxoxoxoxoxoxoxoxoy", "oy", 22},
|
||||
|
||||
@@ -32,7 +32,8 @@ func (r *Reader) Len() int {
|
||||
|
||||
// Size returns the original length of the underlying byte slice.
|
||||
// Size is the number of bytes available for reading via ReadAt.
|
||||
// The result is unaffected by any method calls except Reset.
|
||||
// The returned value is always the same and is not affected by calls
|
||||
// to any other method.
|
||||
func (r *Reader) Size() int64 { return int64(len(r.s)) }
|
||||
|
||||
// Read implements the io.Reader interface.
|
||||
|
||||
@@ -10,7 +10,7 @@ set GOBUILDFAIL=0
|
||||
|
||||
go tool dist env -w -p >env.bat
|
||||
if errorlevel 1 goto fail
|
||||
call .\env.bat
|
||||
call env.bat
|
||||
del env.bat
|
||||
echo.
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ import (
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"go/types"
|
||||
exec "internal/execabs"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
|
||||
@@ -11,11 +11,11 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
exec "internal/execabs"
|
||||
"internal/goversion"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
@@ -37,8 +37,6 @@ Flags:
|
||||
Write symbol ABI information to output file. Don't assemble.
|
||||
-o file
|
||||
Write output to file. The default is foo.o for /a/b/c/foo.s.
|
||||
-p pkgpath
|
||||
Set expected package import to pkgpath.
|
||||
-shared
|
||||
Generate code that can be linked into a shared library.
|
||||
-spectre list
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/obj/arm"
|
||||
"cmd/internal/obj/arm64"
|
||||
"cmd/internal/obj/loong64"
|
||||
"cmd/internal/obj/mips"
|
||||
"cmd/internal/obj/ppc64"
|
||||
"cmd/internal/obj/riscv"
|
||||
@@ -61,8 +60,6 @@ func Set(GOARCH string, shared bool) *Arch {
|
||||
return archArm()
|
||||
case "arm64":
|
||||
return archArm64()
|
||||
case "loong64":
|
||||
return archLoong64(&loong64.Linkloong64)
|
||||
case "mips":
|
||||
return archMips(&mips.Linkmips)
|
||||
case "mipsle":
|
||||
@@ -505,59 +502,6 @@ func archMips64(linkArch *obj.LinkArch) *Arch {
|
||||
}
|
||||
}
|
||||
|
||||
func archLoong64(linkArch *obj.LinkArch) *Arch {
|
||||
register := make(map[string]int16)
|
||||
// Create maps for easy lookup of instruction names etc.
|
||||
// Note that there is no list of names as there is for x86.
|
||||
for i := loong64.REG_R0; i <= loong64.REG_R31; i++ {
|
||||
register[obj.Rconv(i)] = int16(i)
|
||||
}
|
||||
for i := loong64.REG_F0; i <= loong64.REG_F31; i++ {
|
||||
register[obj.Rconv(i)] = int16(i)
|
||||
}
|
||||
for i := loong64.REG_FCSR0; i <= loong64.REG_FCSR31; i++ {
|
||||
register[obj.Rconv(i)] = int16(i)
|
||||
}
|
||||
for i := loong64.REG_FCC0; i <= loong64.REG_FCC31; i++ {
|
||||
register[obj.Rconv(i)] = int16(i)
|
||||
}
|
||||
// Pseudo-registers.
|
||||
register["SB"] = RSB
|
||||
register["FP"] = RFP
|
||||
register["PC"] = RPC
|
||||
// Avoid unintentionally clobbering g using R22.
|
||||
delete(register, "R22")
|
||||
register["g"] = loong64.REG_R22
|
||||
register["RSB"] = loong64.REG_R31
|
||||
registerPrefix := map[string]bool{
|
||||
"F": true,
|
||||
"FCSR": true,
|
||||
"FCC": true,
|
||||
"R": true,
|
||||
}
|
||||
|
||||
instructions := make(map[string]obj.As)
|
||||
for i, s := range obj.Anames {
|
||||
instructions[s] = obj.As(i)
|
||||
}
|
||||
for i, s := range loong64.Anames {
|
||||
if obj.As(i) >= obj.A_ARCHSPECIFIC {
|
||||
instructions[s] = obj.As(i) + obj.ABaseLoong64
|
||||
}
|
||||
}
|
||||
// Annoying alias.
|
||||
instructions["JAL"] = loong64.AJAL
|
||||
|
||||
return &Arch{
|
||||
LinkArch: linkArch,
|
||||
Instructions: instructions,
|
||||
Register: register,
|
||||
RegisterPrefix: registerPrefix,
|
||||
RegisterNumber: loong64RegisterNumber,
|
||||
IsJump: jumpLoong64,
|
||||
}
|
||||
}
|
||||
|
||||
func archRISCV64(shared bool) *Arch {
|
||||
register := make(map[string]int16)
|
||||
|
||||
|
||||
@@ -47,11 +47,6 @@ var arm64Jump = map[string]bool{
|
||||
"JMP": true,
|
||||
"TBNZ": true,
|
||||
"TBZ": true,
|
||||
|
||||
// ADR isn't really a jump, but it takes a PC or label reference,
|
||||
// which needs to patched like a jump.
|
||||
"ADR": true,
|
||||
"ADRP": true,
|
||||
}
|
||||
|
||||
func jumpArm64(word string) bool {
|
||||
@@ -86,16 +81,6 @@ func GetARM64SpecialOperand(name string) arm64.SpecialOperand {
|
||||
return arm64.SPOP_END
|
||||
}
|
||||
|
||||
// IsARM64ADR reports whether the op (as defined by an arm64.A* constant) is
|
||||
// one of the comparison instructions that require special handling.
|
||||
func IsARM64ADR(op obj.As) bool {
|
||||
switch op {
|
||||
case arm64.AADR, arm64.AADRP:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsARM64CMP reports whether the op (as defined by an arm64.A* constant) is
|
||||
// one of the comparison instructions that require special handling.
|
||||
func IsARM64CMP(op obj.As) bool {
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
// This file encapsulates some of the odd characteristics of the
|
||||
// Loong64 (LoongArch64) instruction set, to minimize its interaction
|
||||
// with the core of the assembler.
|
||||
|
||||
package arch
|
||||
|
||||
import (
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/obj/loong64"
|
||||
)
|
||||
|
||||
func jumpLoong64(word string) bool {
|
||||
switch word {
|
||||
case "BEQ", "BFPF", "BFPT", "BLTZ", "BGEZ", "BLEZ", "BGTZ", "BLT", "BLTU", "JIRL", "BNE", "BGE", "BGEU", "JMP", "JAL", "CALL":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsLoong64CMP reports whether the op (as defined by an loong64.A* constant) is
|
||||
// one of the CMP instructions that require special handling.
|
||||
func IsLoong64CMP(op obj.As) bool {
|
||||
switch op {
|
||||
case loong64.ACMPEQF, loong64.ACMPEQD, loong64.ACMPGEF, loong64.ACMPGED,
|
||||
loong64.ACMPGTF, loong64.ACMPGTD:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsLoong64MUL reports whether the op (as defined by an loong64.A* constant) is
|
||||
// one of the MUL/DIV/REM instructions that require special handling.
|
||||
func IsLoong64MUL(op obj.As) bool {
|
||||
switch op {
|
||||
case loong64.AMUL, loong64.AMULU, loong64.AMULV, loong64.AMULVU,
|
||||
loong64.ADIV, loong64.ADIVU, loong64.ADIVV, loong64.ADIVVU,
|
||||
loong64.AREM, loong64.AREMU, loong64.AREMV, loong64.AREMVU:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func loong64RegisterNumber(name string, n int16) (int16, bool) {
|
||||
switch name {
|
||||
case "F":
|
||||
if 0 <= n && n <= 31 {
|
||||
return loong64.REG_F0 + n, true
|
||||
}
|
||||
case "FCSR":
|
||||
if 0 <= n && n <= 31 {
|
||||
return loong64.REG_FCSR0 + n, true
|
||||
}
|
||||
case "FCC":
|
||||
if 0 <= n && n <= 31 {
|
||||
return loong64.REG_FCC0 + n, true
|
||||
}
|
||||
case "R":
|
||||
if 0 <= n && n <= 31 {
|
||||
return loong64.REG_R0 + n, true
|
||||
}
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import (
|
||||
"cmd/asm/internal/flags"
|
||||
"cmd/asm/internal/lex"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/obj/ppc64"
|
||||
"cmd/internal/obj/x86"
|
||||
"cmd/internal/objabi"
|
||||
"cmd/internal/sys"
|
||||
@@ -394,7 +393,6 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
|
||||
Pos: p.pos(),
|
||||
As: op,
|
||||
}
|
||||
targetAddr := &prog.To
|
||||
switch len(a) {
|
||||
case 0:
|
||||
if p.arch.Family == sys.Wasm {
|
||||
@@ -407,57 +405,24 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
|
||||
target = &a[0]
|
||||
case 2:
|
||||
// Special 2-operand jumps.
|
||||
if p.arch.Family == sys.ARM64 && arch.IsARM64ADR(op) {
|
||||
// ADR label, R. Label is in From.
|
||||
target = &a[0]
|
||||
prog.To = a[1]
|
||||
targetAddr = &prog.From
|
||||
} else {
|
||||
target = &a[1]
|
||||
prog.From = a[0]
|
||||
}
|
||||
target = &a[1]
|
||||
prog.From = a[0]
|
||||
case 3:
|
||||
if p.arch.Family == sys.PPC64 {
|
||||
// Special 3-operand jumps.
|
||||
// a[1] is a register number expressed as a constant or register value
|
||||
// First two must be constants; a[1] is a register number.
|
||||
target = &a[2]
|
||||
prog.From = a[0]
|
||||
if a[0].Type != obj.TYPE_CONST {
|
||||
// Legacy code may use a plain constant, accept it, and coerce
|
||||
// into a constant. E.g:
|
||||
// BC 4,...
|
||||
// into
|
||||
// BC $4,...
|
||||
prog.From = obj.Addr{
|
||||
Type: obj.TYPE_CONST,
|
||||
Offset: p.getConstant(prog, op, &a[0]),
|
||||
}
|
||||
|
||||
prog.From = obj.Addr{
|
||||
Type: obj.TYPE_CONST,
|
||||
Offset: p.getConstant(prog, op, &a[0]),
|
||||
}
|
||||
|
||||
// Likewise, fixup usage like:
|
||||
// BC x,LT,...
|
||||
// BC x,foo+2,...
|
||||
// BC x,4
|
||||
// BC x,$5
|
||||
// into
|
||||
// BC x,CR0LT,...
|
||||
// BC x,CR0EQ,...
|
||||
// BC x,CR1LT,...
|
||||
// BC x,CR1GT,...
|
||||
// The first and second case demonstrate a symbol name which is
|
||||
// effectively discarded. In these cases, the offset determines
|
||||
// the CR bit.
|
||||
prog.Reg = a[1].Reg
|
||||
if a[1].Type != obj.TYPE_REG {
|
||||
// The CR bit is represented as a constant 0-31. Convert it to a Reg.
|
||||
c := p.getConstant(prog, op, &a[1])
|
||||
reg, success := ppc64.ConstantToCRbit(c)
|
||||
if !success {
|
||||
p.errorf("invalid CR bit register number %d", c)
|
||||
}
|
||||
prog.Reg = reg
|
||||
reg := int16(p.getConstant(prog, op, &a[1]))
|
||||
reg, ok := p.arch.RegisterNumber("R", reg)
|
||||
if !ok {
|
||||
p.errorf("bad register number %d", reg)
|
||||
return
|
||||
}
|
||||
prog.Reg = reg
|
||||
break
|
||||
}
|
||||
if p.arch.Family == sys.MIPS || p.arch.Family == sys.MIPS64 || p.arch.Family == sys.RISCV64 {
|
||||
@@ -468,14 +433,6 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
break
|
||||
}
|
||||
if p.arch.Family == sys.Loong64 {
|
||||
// 3-operand jumps.
|
||||
// First two must be registers
|
||||
target = &a[2]
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
break
|
||||
}
|
||||
if p.arch.Family == sys.S390X {
|
||||
// 3-operand jumps.
|
||||
target = &a[2]
|
||||
@@ -504,7 +461,7 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
|
||||
p.errorf("wrong number of arguments to %s instruction", op)
|
||||
return
|
||||
case 4:
|
||||
if p.arch.Family == sys.S390X || p.arch.Family == sys.PPC64 {
|
||||
if p.arch.Family == sys.S390X {
|
||||
// 4-operand compare-and-branch.
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
@@ -521,20 +478,20 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
|
||||
switch {
|
||||
case target.Type == obj.TYPE_BRANCH:
|
||||
// JMP 4(PC)
|
||||
*targetAddr = obj.Addr{
|
||||
prog.To = obj.Addr{
|
||||
Type: obj.TYPE_BRANCH,
|
||||
Offset: p.pc + 1 + target.Offset, // +1 because p.pc is incremented in append, below.
|
||||
}
|
||||
case target.Type == obj.TYPE_REG:
|
||||
// JMP R1
|
||||
*targetAddr = *target
|
||||
prog.To = *target
|
||||
case target.Type == obj.TYPE_MEM && (target.Name == obj.NAME_EXTERN || target.Name == obj.NAME_STATIC):
|
||||
// JMP main·morestack(SB)
|
||||
*targetAddr = *target
|
||||
prog.To = *target
|
||||
case target.Type == obj.TYPE_INDIR && (target.Name == obj.NAME_EXTERN || target.Name == obj.NAME_STATIC):
|
||||
// JMP *main·morestack(SB)
|
||||
*targetAddr = *target
|
||||
targetAddr.Type = obj.TYPE_INDIR
|
||||
prog.To = *target
|
||||
prog.To.Type = obj.TYPE_INDIR
|
||||
case target.Type == obj.TYPE_MEM && target.Reg == 0 && target.Offset == 0:
|
||||
// JMP exit
|
||||
if target.Sym == nil {
|
||||
@@ -543,20 +500,20 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
|
||||
}
|
||||
targetProg := p.labels[target.Sym.Name]
|
||||
if targetProg == nil {
|
||||
p.toPatch = append(p.toPatch, Patch{targetAddr, target.Sym.Name})
|
||||
p.toPatch = append(p.toPatch, Patch{prog, target.Sym.Name})
|
||||
} else {
|
||||
p.branch(targetAddr, targetProg)
|
||||
p.branch(prog, targetProg)
|
||||
}
|
||||
case target.Type == obj.TYPE_MEM && target.Name == obj.NAME_NONE:
|
||||
// JMP 4(R0)
|
||||
*targetAddr = *target
|
||||
prog.To = *target
|
||||
// On the ppc64, 9a encodes BR (CTR) as BR CTR. We do the same.
|
||||
if p.arch.Family == sys.PPC64 && target.Offset == 0 {
|
||||
targetAddr.Type = obj.TYPE_REG
|
||||
prog.To.Type = obj.TYPE_REG
|
||||
}
|
||||
case target.Type == obj.TYPE_CONST:
|
||||
// JMP $4
|
||||
*targetAddr = a[0]
|
||||
prog.To = a[0]
|
||||
case target.Type == obj.TYPE_NONE:
|
||||
// JMP
|
||||
default:
|
||||
@@ -574,17 +531,17 @@ func (p *Parser) patch() {
|
||||
p.errorf("undefined label %s", patch.label)
|
||||
return
|
||||
}
|
||||
p.branch(patch.addr, targetProg)
|
||||
p.branch(patch.prog, targetProg)
|
||||
}
|
||||
p.toPatch = p.toPatch[:0]
|
||||
}
|
||||
|
||||
func (p *Parser) branch(addr *obj.Addr, target *obj.Prog) {
|
||||
*addr = obj.Addr{
|
||||
func (p *Parser) branch(jmp, target *obj.Prog) {
|
||||
jmp.To = obj.Addr{
|
||||
Type: obj.TYPE_BRANCH,
|
||||
Index: 0,
|
||||
}
|
||||
addr.Val = target
|
||||
jmp.To.Val = target
|
||||
}
|
||||
|
||||
// asmInstruction assembles an instruction.
|
||||
@@ -636,12 +593,6 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
break
|
||||
}
|
||||
} else if p.arch.Family == sys.Loong64 {
|
||||
if arch.IsLoong64CMP(op) {
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
break
|
||||
}
|
||||
}
|
||||
prog.From = a[0]
|
||||
prog.To = a[1]
|
||||
@@ -651,10 +602,6 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
prog.To = a[2]
|
||||
case sys.Loong64:
|
||||
prog.From = a[0]
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
prog.To = a[2]
|
||||
case sys.ARM:
|
||||
// Special cases.
|
||||
if arch.IsARMSTREX(op) {
|
||||
|
||||
@@ -447,13 +447,6 @@ func TestMIPSEndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "mips64", "mips64")
|
||||
}
|
||||
|
||||
func TestLOONG64Encoder(t *testing.T) {
|
||||
testEndToEnd(t, "loong64", "loong64enc1")
|
||||
testEndToEnd(t, "loong64", "loong64enc2")
|
||||
testEndToEnd(t, "loong64", "loong64enc3")
|
||||
testEndToEnd(t, "loong64", "loong64")
|
||||
}
|
||||
|
||||
func TestPPC64EndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "ppc64", "ppc64")
|
||||
}
|
||||
|
||||
@@ -125,11 +125,6 @@ func TestMIPS64OperandParser(t *testing.T) {
|
||||
testOperandParser(t, parser, mips64OperandTests)
|
||||
}
|
||||
|
||||
func TestLOONG64OperandParser(t *testing.T) {
|
||||
parser := newParser("loong64")
|
||||
testOperandParser(t, parser, loong64OperandTests)
|
||||
}
|
||||
|
||||
func TestS390XOperandParser(t *testing.T) {
|
||||
parser := newParser("s390x")
|
||||
testOperandParser(t, parser, s390xOperandTests)
|
||||
@@ -148,7 +143,6 @@ func TestFuncAddress(t *testing.T) {
|
||||
{"ppc64", ppc64OperandTests},
|
||||
{"mips", mipsOperandTests},
|
||||
{"mips64", mips64OperandTests},
|
||||
{"loong64", loong64OperandTests},
|
||||
{"s390x", s390xOperandTests},
|
||||
} {
|
||||
t.Run(sub.arch, func(t *testing.T) {
|
||||
@@ -851,88 +845,6 @@ var mipsOperandTests = []operandTest{
|
||||
{"[):[o-FP", ""}, // Issue 12469 - asm hung parsing the o-FP range on non ARM platforms.
|
||||
}
|
||||
|
||||
var loong64OperandTests = []operandTest{
|
||||
{"$((1<<63)-1)", "$9223372036854775807"},
|
||||
{"$(-64*1024)", "$-65536"},
|
||||
{"$(1024 * 8)", "$8192"},
|
||||
{"$-1", "$-1"},
|
||||
{"$-24(R4)", "$-24(R4)"},
|
||||
{"$0", "$0"},
|
||||
{"$0(R1)", "$(R1)"},
|
||||
{"$0.5", "$(0.5)"},
|
||||
{"$0x7000", "$28672"},
|
||||
{"$0x88888eef", "$2290650863"},
|
||||
{"$1", "$1"},
|
||||
{"$_main<>(SB)", "$_main<>(SB)"},
|
||||
{"$argframe(FP)", "$argframe(FP)"},
|
||||
{"$~3", "$-4"},
|
||||
{"(-288-3*8)(R1)", "-312(R1)"},
|
||||
{"(16)(R7)", "16(R7)"},
|
||||
{"(8)(g)", "8(g)"},
|
||||
{"(R0)", "(R0)"},
|
||||
{"(R3)", "(R3)"},
|
||||
{"(R4)", "(R4)"},
|
||||
{"(R5)", "(R5)"},
|
||||
{"-1(R4)", "-1(R4)"},
|
||||
{"-1(R5)", "-1(R5)"},
|
||||
{"6(PC)", "6(PC)"},
|
||||
{"F14", "F14"},
|
||||
{"F15", "F15"},
|
||||
{"F16", "F16"},
|
||||
{"F17", "F17"},
|
||||
{"F18", "F18"},
|
||||
{"F19", "F19"},
|
||||
{"F20", "F20"},
|
||||
{"F21", "F21"},
|
||||
{"F22", "F22"},
|
||||
{"F23", "F23"},
|
||||
{"F24", "F24"},
|
||||
{"F25", "F25"},
|
||||
{"F26", "F26"},
|
||||
{"F27", "F27"},
|
||||
{"F28", "F28"},
|
||||
{"F29", "F29"},
|
||||
{"F30", "F30"},
|
||||
{"F31", "F31"},
|
||||
{"R0", "R0"},
|
||||
{"R1", "R1"},
|
||||
{"R11", "R11"},
|
||||
{"R12", "R12"},
|
||||
{"R13", "R13"},
|
||||
{"R14", "R14"},
|
||||
{"R15", "R15"},
|
||||
{"R16", "R16"},
|
||||
{"R17", "R17"},
|
||||
{"R18", "R18"},
|
||||
{"R19", "R19"},
|
||||
{"R2", "R2"},
|
||||
{"R20", "R20"},
|
||||
{"R21", "R21"},
|
||||
{"R23", "R23"},
|
||||
{"R24", "R24"},
|
||||
{"R25", "R25"},
|
||||
{"R26", "R26"},
|
||||
{"R27", "R27"},
|
||||
{"R28", "R28"},
|
||||
{"R29", "R29"},
|
||||
{"R30", "R30"},
|
||||
{"R3", "R3"},
|
||||
{"R4", "R4"},
|
||||
{"R5", "R5"},
|
||||
{"R6", "R6"},
|
||||
{"R7", "R7"},
|
||||
{"R8", "R8"},
|
||||
{"R9", "R9"},
|
||||
{"a(FP)", "a(FP)"},
|
||||
{"g", "g"},
|
||||
{"RSB", "R31"},
|
||||
{"ret+8(FP)", "ret+8(FP)"},
|
||||
{"runtime·abort(SB)", "runtime.abort(SB)"},
|
||||
{"·AddUint32(SB)", "\"\".AddUint32(SB)"},
|
||||
{"·trunc(SB)", "\"\".trunc(SB)"},
|
||||
{"[):[o-FP", ""}, // Issue 12469 - asm hung parsing the o-FP range on non ARM platforms.
|
||||
}
|
||||
|
||||
var s390xOperandTests = []operandTest{
|
||||
{"$((1<<63)-1)", "$9223372036854775807"},
|
||||
{"$(-64*1024)", "$-65536"},
|
||||
|
||||
@@ -49,7 +49,7 @@ type Parser struct {
|
||||
}
|
||||
|
||||
type Patch struct {
|
||||
addr *obj.Addr
|
||||
prog *obj.Prog
|
||||
label string
|
||||
}
|
||||
|
||||
|
||||
2
src/cmd/asm/internal/asm/testdata/arm.s
vendored
2
src/cmd/asm/internal/asm/testdata/arm.s
vendored
@@ -1042,7 +1042,7 @@ jmp_label_3:
|
||||
BFI $29, $2, R8 // 1881dee7
|
||||
BFI $16, $8, R1, R2 // BFI $16, R1, $8, R2 // 1124d7e7
|
||||
|
||||
// synthetic arithmetic
|
||||
// synthetic arithmatic
|
||||
ADD $0xffffffaa, R2, R3 // ADD $4294967210, R2, R3 // 55b0e0e30b3082e0
|
||||
ADD $0xffffff55, R5 // ADD $4294967125, R5 // aab0e0e30b5085e0
|
||||
ADD.S $0xffffffab, R2, R3 // ADD.S $4294967211, R2, R3 // 54b0e0e30b3092e0
|
||||
|
||||
6
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
6
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
@@ -10,6 +10,7 @@
|
||||
|
||||
TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
|
||||
|
||||
// arithmetic operations
|
||||
ADDW $1, R2, R3
|
||||
ADDW R1, R2, R3
|
||||
@@ -850,11 +851,6 @@ again:
|
||||
JMP foo(SB)
|
||||
CALL foo(SB)
|
||||
|
||||
// ADR
|
||||
ADR next, R11 // ADR R11 // 2b000010
|
||||
next:
|
||||
NOP
|
||||
|
||||
// LDP/STP
|
||||
LDP (R0), (R0, R1) // 000440a9
|
||||
LDP (R0), (R1, R2) // 010840a9
|
||||
|
||||
11
src/cmd/asm/internal/asm/testdata/loong64.s
vendored
11
src/cmd/asm/internal/asm/testdata/loong64.s
vendored
@@ -1,11 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
#include "../../../../../runtime/textflag.h"
|
||||
// TODO: cover more instruction
|
||||
|
||||
TEXT foo(SB),DUPOK|NOSPLIT,$0
|
||||
JAL 1(PC) //CALL 1(PC) //000c0054
|
||||
JAL (R4) //CALL (R4) //8100004c
|
||||
JAL foo(SB) //CALL foo(SB) //00100054
|
||||
209
src/cmd/asm/internal/asm/testdata/loong64enc1.s
vendored
209
src/cmd/asm/internal/asm/testdata/loong64enc1.s
vendored
@@ -1,209 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
#include "../../../../../runtime/textflag.h"
|
||||
|
||||
TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
lable1:
|
||||
BFPT 1(PC) // 00050048
|
||||
BFPT lable1 // BFPT 2 //1ffdff4b
|
||||
|
||||
lable2:
|
||||
BFPF 1(PC) // 00040048
|
||||
BFPF lable2 // BFPF 4 // 1ffcff4b
|
||||
|
||||
JMP foo(SB) // 00100050
|
||||
JMP (R4) // 8000004c
|
||||
JMP 1(PC) // 00040058
|
||||
MOVW $65536, R4 // 04020014
|
||||
MOVW $4096, R4 // 24000014
|
||||
MOVV $65536, R4 // 04020014
|
||||
MOVV $4096, R4 // 24000014
|
||||
MOVW R4, R5 // 85001700
|
||||
MOVV R4, R5 // 85001500
|
||||
MOVBU R4, R5 // 85fc4303
|
||||
SUB R4, R5, R6 // a6101100
|
||||
SUBV R4, R5, R6 // a6901100
|
||||
ADD R4, R5, R6 // a6101000
|
||||
ADDV R4, R5, R6 // a6901000
|
||||
AND R4, R5, R6 // a6901400
|
||||
SUB R4, R5 // a5101100
|
||||
SUBV R4, R5 // a5901100
|
||||
ADD R4, R5 // a5101000
|
||||
ADDV R4, R5 // a5901000
|
||||
AND R4, R5 // a5901400
|
||||
NEGW R4, R5 // 05101100
|
||||
NEGV R4, R5 // 05901100
|
||||
SLL R4, R5 // a5101700
|
||||
SLL R4, R5, R6 // a6101700
|
||||
SRL R4, R5 // a5901700
|
||||
SRL R4, R5, R6 // a6901700
|
||||
SRA R4, R5 // a5101800
|
||||
SRA R4, R5, R6 // a6101800
|
||||
SLLV R4, R5 // a5901800
|
||||
SLLV R4, R5, R6 // a6901800
|
||||
CLO R4, R5 // 85100000
|
||||
CLZ R4, R5 // 85140000
|
||||
ADDF F4, F5 // a5900001
|
||||
ADDF F4, R5, F6 // a6900001
|
||||
CMPEQF F4, R5 // a010120c
|
||||
ABSF F4, F5 // 85041401
|
||||
MOVVF F4, F5 // 85181d01
|
||||
MOVF F4, F5 // 85941401
|
||||
MOVD F4, F5 // 85981401
|
||||
MOVW R4, result+16(FP) // 64608029
|
||||
MOVWU R4, result+16(FP) // 64608029
|
||||
MOVV R4, result+16(FP) // 6460c029
|
||||
MOVB R4, result+16(FP) // 64600029
|
||||
MOVBU R4, result+16(FP) // 64600029
|
||||
MOVWL R4, result+16(FP) // 6460002f
|
||||
MOVVL R4, result+16(FP) // 6460802f
|
||||
MOVW R4, 1(R5) // a4048029
|
||||
MOVWU R4, 1(R5) // a4048029
|
||||
MOVV R4, 1(R5) // a404c029
|
||||
MOVB R4, 1(R5) // a4040029
|
||||
MOVBU R4, 1(R5) // a4040029
|
||||
MOVWL R4, 1(R5) // a404002f
|
||||
MOVVL R4, 1(R5) // a404802f
|
||||
SC R4, 1(R5) // a4040021
|
||||
SCV R4, 1(R5) // a4040023
|
||||
MOVW y+8(FP), R4 // 64408028
|
||||
MOVWU y+8(FP), R4 // 6440802a
|
||||
MOVV y+8(FP), R4 // 6440c028
|
||||
MOVB y+8(FP), R4 // 64400028
|
||||
MOVBU y+8(FP), R4 // 6440002a
|
||||
MOVWL y+8(FP), R4 // 6440002e
|
||||
MOVVL y+8(FP), R4 // 6440802e
|
||||
MOVW 1(R5), R4 // a4048028
|
||||
MOVWU 1(R5), R4 // a404802a
|
||||
MOVV 1(R5), R4 // a404c028
|
||||
MOVB 1(R5), R4 // a4040028
|
||||
MOVBU 1(R5), R4 // a404002a
|
||||
MOVWL 1(R5), R4 // a404002e
|
||||
MOVVL 1(R5), R4 // a404802e
|
||||
LL 1(R5), R4 // a4040020
|
||||
LLV 1(R5), R4 // a4040022
|
||||
MOVW $4(R4), R5 // 8510c002
|
||||
MOVV $4(R4), R5 // 8510c002
|
||||
MOVW $-1, R4 // 04fcff02
|
||||
MOVV $-1, R4 // 04fcff02
|
||||
MOVW $1, R4 // 0404c002
|
||||
MOVV $1, R4 // 0404c002
|
||||
ADD $-1, R4, R5 // 85fcbf02
|
||||
ADD $-1, R4 // 84fcbf02
|
||||
ADDV $-1, R4, R5 // 85fcff02
|
||||
ADDV $-1, R4 // 84fcff02
|
||||
AND $1, R4, R5 // 85044003
|
||||
AND $1, R4 // 84044003
|
||||
SLL $4, R4, R5 // 85904000
|
||||
SLL $4, R4 // 84904000
|
||||
SRL $4, R4, R5 // 85904400
|
||||
SRL $4, R4 // 84904400
|
||||
SRA $4, R4, R5 // 85904800
|
||||
SRA $4, R4 // 84904800
|
||||
SLLV $4, R4, R5 // 85104100
|
||||
SLLV $4, R4 // 84104100
|
||||
SYSCALL // 00002b00
|
||||
BEQ R4, R5, 1(PC) // 85040058
|
||||
BEQ R4, 1(PC) // 80040058
|
||||
BLTU R4, 1(PC) // 80040068
|
||||
MOVW y+8(FP), F4 // 6440002b
|
||||
MOVF y+8(FP), F4 // 6440002b
|
||||
MOVD y+8(FP), F4 // 6440802b
|
||||
MOVW 1(F5), F4 // a404002b
|
||||
MOVF 1(F5), F4 // a404002b
|
||||
MOVD 1(F5), F4 // a404802b
|
||||
MOVW F4, result+16(FP) // 6460402b
|
||||
MOVF F4, result+16(FP) // 6460402b
|
||||
MOVD F4, result+16(FP) // 6460c02b
|
||||
MOVW F4, 1(F5) // a404402b
|
||||
MOVF F4, 1(F5) // a404402b
|
||||
MOVD F4, 1(F5) // a404c02b
|
||||
MOVW R4, F5 // 85a41401
|
||||
MOVW F4, R5 // 85b41401
|
||||
MOVV R4, F5 // 85a81401
|
||||
MOVV F4, R5 // 85b81401
|
||||
WORD $74565 // 45230100
|
||||
BREAK R4, result+16(FP) // 64600006
|
||||
BREAK R4, 1(R5) // a4040006
|
||||
BREAK // 00002a00
|
||||
UNDEF // 00002a00
|
||||
|
||||
// mul
|
||||
MUL R4, R5 // a5101c00
|
||||
MUL R4, R5, R6 // a6101c00
|
||||
MULV R4, R5 // a5901d00
|
||||
MULV R4, R5, R6 // a6901d00
|
||||
MULVU R4, R5 // a5901d00
|
||||
MULVU R4, R5, R6 // a6901d00
|
||||
MULHV R4, R5 // a5101e00
|
||||
MULHV R4, R5, R6 // a6101e00
|
||||
MULHVU R4, R5 // a5901e00
|
||||
MULHVU R4, R5, R6 // a6901e00
|
||||
REMV R4, R5 // a5902200
|
||||
REMV R4, R5, R6 // a6902200
|
||||
REMVU R4, R5 // a5902300
|
||||
REMVU R4, R5, R6 // a6902300
|
||||
DIVV R4, R5 // a5102200
|
||||
DIVV R4, R5, R6 // a6102200
|
||||
DIVVU R4, R5 // a5102300
|
||||
DIVVU R4, R5, R6 // a6102300
|
||||
|
||||
MOVH R4, result+16(FP) // 64604029
|
||||
MOVH R4, 1(R5) // a4044029
|
||||
MOVH y+8(FP), R4 // 64404028
|
||||
MOVH 1(R5), R4 // a4044028
|
||||
MOVHU R4, R5 // 8500cf00
|
||||
MOVHU R4, result+16(FP) // 64604029
|
||||
MOVHU R4, 1(R5) // a4044029
|
||||
MOVHU y+8(FP), R4 // 6440402a
|
||||
MOVHU 1(R5), R4 // a404402a
|
||||
MULU R4, R5 // a5101c00
|
||||
MULU R4, R5, R6 // a6101c00
|
||||
MULH R4, R5 // a5901c00
|
||||
MULH R4, R5, R6 // a6901c00
|
||||
MULHU R4, R5 // a5101d00
|
||||
MULHU R4, R5, R6 // a6101d00
|
||||
REM R4, R5 // a5902000
|
||||
REM R4, R5, R6 // a6902000
|
||||
REMU R4, R5 // a5902100
|
||||
REMU R4, R5, R6 // a6902100
|
||||
DIV R4, R5 // a5102000
|
||||
DIV R4, R5, R6 // a6102000
|
||||
DIVU R4, R5 // a5102100
|
||||
DIVU R4, R5, R6 // a6102100
|
||||
SRLV R4, R5 // a5101900
|
||||
SRLV R4, R5, R6 // a6101900
|
||||
SRLV $4, R4, R5 // 85104500
|
||||
SRLV $4, R4 // 84104500
|
||||
SRLV $32, R4, R5 // 85804500
|
||||
SRLV $32, R4 // 84804500
|
||||
|
||||
MOVFD F4, F5 // 85241901
|
||||
MOVDF F4, F5 // 85181901
|
||||
MOVWF F4, F5 // 85101d01
|
||||
MOVFW F4, F5 // 85041b01
|
||||
MOVWD F4, F5 // 85201d01
|
||||
MOVDW F4, F5 // 85081b01
|
||||
NEGF F4, F5 // 85141401
|
||||
NEGD F4, F5 // 85181401
|
||||
ABSD F4, F5 // 85081401
|
||||
TRUNCDW F4, F5 // 85881a01
|
||||
TRUNCFW F4, F5 // 85841a01
|
||||
SQRTF F4, F5 // 85441401
|
||||
SQRTD F4, F5 // 85481401
|
||||
|
||||
DBAR // 00007238
|
||||
NOOP // 00004003
|
||||
|
||||
MOVWR R4, result+16(FP) // 6460402f
|
||||
MOVWR R4, 1(R5) // a404402f
|
||||
MOVWR y+8(FP), R4 // 6440402e
|
||||
MOVWR 1(R5), R4 // a404402e
|
||||
|
||||
CMPGTF F4, R5 // a090110c
|
||||
CMPGTD F4, R5 // a090210c
|
||||
CMPGEF F4, R5 // a090130c
|
||||
CMPGED F4, R5 // a090230c
|
||||
CMPEQD F4, R5 // a010220c
|
||||
82
src/cmd/asm/internal/asm/testdata/loong64enc2.s
vendored
82
src/cmd/asm/internal/asm/testdata/loong64enc2.s
vendored
@@ -1,82 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
#include "../../../../../runtime/textflag.h"
|
||||
|
||||
TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVB R4, R5 // 85e04000a5e04800
|
||||
MOVWU R4, R5 // 85804100a5804500
|
||||
MOVW $74565, R4 // 4402001484148d03
|
||||
MOVW $4097, R4 // 2400001484048003
|
||||
MOVV $74565, R4 // 4402001484148d03
|
||||
MOVV $4097, R4 // 2400001484048003
|
||||
AND $-1, R4, R5 // 1efcbf0285f81400
|
||||
AND $-1, R4 // 1efcbf0284f81400
|
||||
MOVW $-1, F4 // 1efcbf02c4a71401
|
||||
MOVW $1, F4 // 1e048002c4a71401
|
||||
TEQ $4, R4, R5 // 8508005c04002a00
|
||||
TEQ $4, R4 // 0408005c04002a00
|
||||
TNE $4, R4, R5 // 8508005804002a00
|
||||
TNE $4, R4 // 0408005804002a00
|
||||
ADD $65536, R4, R5 // 1e02001485781000
|
||||
ADD $4096, R4, R5 // 3e00001485781000
|
||||
ADD $65536, R4 // 1e02001484781000
|
||||
ADD $4096, R4 // 3e00001484781000
|
||||
ADDV $65536, R4, R5 // 1e02001485f81000
|
||||
ADDV $4096, R4, R5 // 3e00001485f81000
|
||||
ADDV $65536, R4 // 1e02001484f81000
|
||||
ADDV $4096, R4 // 3e00001484f81000
|
||||
AND $65536, R4, R5 // 1e02001485f81400
|
||||
AND $4096, R4, R5 // 3e00001485f81400
|
||||
AND $65536, R4 // 1e02001484f81400
|
||||
AND $4096, R4 // 3e00001484f81400
|
||||
SGT $65536, R4, R5 // 1e02001485781200
|
||||
SGT $4096, R4, R5 // 3e00001485781200
|
||||
SGT $65536, R4 // 1e02001484781200
|
||||
SGT $4096, R4 // 3e00001484781200
|
||||
SGTU $65536, R4, R5 // 1e02001485f81200
|
||||
SGTU $4096, R4, R5 // 3e00001485f81200
|
||||
SGTU $65536, R4 // 1e02001484f81200
|
||||
SGTU $4096, R4 // 3e00001484f81200
|
||||
ADDU $65536, R4, R5 // 1e02001485781000
|
||||
ADDU $4096, R4, R5 // 3e00001485781000
|
||||
ADDU $65536, R4 // 1e02001484781000
|
||||
ADDU $4096, R4 // 3e00001484781000
|
||||
ADDVU $65536, R4, R5 // 1e02001485f81000
|
||||
ADDVU $4096, R4, R5 // 3e00001485f81000
|
||||
ADDVU $65536, R4 // 1e02001484f81000
|
||||
ADDVU $4096, R4 // 3e00001484f81000
|
||||
OR $65536, R4, R5 // 1e02001485781500
|
||||
OR $4096, R4, R5 // 3e00001485781500
|
||||
OR $65536, R4 // 1e02001484781500
|
||||
OR $4096, R4 // 3e00001484781500
|
||||
OR $-1, R4, R5 // 1efcbf0285781500
|
||||
OR $-1, R4 // 1efcbf0284781500
|
||||
XOR $65536, R4, R5 // 1e02001485f81500
|
||||
XOR $4096, R4, R5 // 3e00001485f81500
|
||||
XOR $65536, R4 // 1e02001484f81500
|
||||
XOR $4096, R4 // 3e00001484f81500
|
||||
XOR $-1, R4, R5 // 1efcbf0285f81500
|
||||
XOR $-1, R4 // 1efcbf0284f81500
|
||||
MOVH R4, R5 // 85c04000a5c04800
|
||||
|
||||
// relocation instructions
|
||||
MOVW R4, name(SB) // 1e00001cc4038029
|
||||
MOVWU R4, name(SB) // 1e00001cc4038029
|
||||
MOVV R4, name(SB) // 1e00001cc403c029
|
||||
MOVB R4, name(SB) // 1e00001cc4030029
|
||||
MOVBU R4, name(SB) // 1e00001cc4030029
|
||||
MOVF F4, name(SB) // 1e00001cc403402b
|
||||
MOVD F4, name(SB) // 1e00001cc403c02b
|
||||
MOVW name(SB), R4 // 1e00001cc4038028
|
||||
MOVWU name(SB), R4 // 1e00001cc403802a
|
||||
MOVV name(SB), R4 // 1e00001cc403c028
|
||||
MOVB name(SB), R4 // 1e00001cc4030028
|
||||
MOVBU name(SB), R4 // 1e00001cc403002a
|
||||
MOVF name(SB), F4 // 1e00001cc403002b
|
||||
MOVD name(SB), F4 // 1e00001cc403802b
|
||||
MOVH R4, name(SB) // 1e00001cc4034029
|
||||
MOVH name(SB), R4 // 1e00001cc4034028
|
||||
MOVHU R4, name(SB) // 1e00001cc4034029
|
||||
MOVHU name(SB), R4 // 1e00001cc403402a
|
||||
131
src/cmd/asm/internal/asm/testdata/loong64enc3.s
vendored
131
src/cmd/asm/internal/asm/testdata/loong64enc3.s
vendored
@@ -1,131 +0,0 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
#include "../../../../../runtime/textflag.h"
|
||||
|
||||
TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVW $65536(R4), R5 // 1e020014de03800385f81000
|
||||
MOVW $4096(R4), R5 // 3e000014de03800385f81000
|
||||
MOVV $65536(R4), R5 // 1e020014de03800385f81000
|
||||
MOVV $4096(R4), R5 // 3e000014de03800385f81000
|
||||
ADD $74565, R4 // 5e020014de178d0384781000
|
||||
ADD $4097, R4 // 3e000014de07800384781000
|
||||
ADDV $74565, R4 // 5e020014de178d0384f81000
|
||||
ADDV $4097, R4 // 3e000014de07800384f81000
|
||||
AND $74565, R4 // 5e020014de178d0384f81400
|
||||
AND $4097, R4 // 3e000014de07800384f81400
|
||||
ADD $74565, R4, R5 // 5e020014de178d0385781000
|
||||
ADD $4097, R4, R5 // 3e000014de07800385781000
|
||||
ADDV $74565, R4, R5 // 5e020014de178d0385f81000
|
||||
ADDV $4097, R4, R5 // 3e000014de07800385f81000
|
||||
AND $74565, R4, R5 // 5e020014de178d0385f81400
|
||||
AND $4097, R4, R5 // 3e000014de07800385f81400
|
||||
|
||||
MOVW R4, result+65540(FP) // 1e020014de8f1000c4338029
|
||||
MOVW R4, result+4097(FP) // 3e000014de8f1000c4278029
|
||||
MOVWU R4, result+65540(FP) // 1e020014de8f1000c4338029
|
||||
MOVWU R4, result+4097(FP) // 3e000014de8f1000c4278029
|
||||
MOVV R4, result+65540(FP) // 1e020014de8f1000c433c029
|
||||
MOVV R4, result+4097(FP) // 3e000014de8f1000c427c029
|
||||
MOVB R4, result+65540(FP) // 1e020014de8f1000c4330029
|
||||
MOVB R4, result+4097(FP) // 3e000014de8f1000c4270029
|
||||
MOVBU R4, result+65540(FP) // 1e020014de8f1000c4330029
|
||||
MOVBU R4, result+4097(FP) // 3e000014de8f1000c4270029
|
||||
MOVW R4, 65536(R5) // 1e020014de971000c4038029
|
||||
MOVW R4, 4096(R5) // 3e000014de971000c4038029
|
||||
MOVWU R4, 65536(R5) // 1e020014de971000c4038029
|
||||
MOVWU R4, 4096(R5) // 3e000014de971000c4038029
|
||||
MOVV R4, 65536(R5) // 1e020014de971000c403c029
|
||||
MOVV R4, 4096(R5) // 3e000014de971000c403c029
|
||||
MOVB R4, 65536(R5) // 1e020014de971000c4030029
|
||||
MOVB R4, 4096(R5) // 3e000014de971000c4030029
|
||||
MOVBU R4, 65536(R5) // 1e020014de971000c4030029
|
||||
MOVBU R4, 4096(R5) // 3e000014de971000c4030029
|
||||
SC R4, 65536(R5) // 1e020014de971000c4030021
|
||||
SC R4, 4096(R5) // 3e000014de971000c4030021
|
||||
MOVW y+65540(FP), R4 // 1e020014de8f1000c4338028
|
||||
MOVWU y+65540(FP), R4 // 1e020014de8f1000c433802a
|
||||
MOVV y+65540(FP), R4 // 1e020014de8f1000c433c028
|
||||
MOVB y+65540(FP), R4 // 1e020014de8f1000c4330028
|
||||
MOVBU y+65540(FP), R4 // 1e020014de8f1000c433002a
|
||||
MOVW y+4097(FP), R4 // 3e000014de8f1000c4278028
|
||||
MOVWU y+4097(FP), R4 // 3e000014de8f1000c427802a
|
||||
MOVV y+4097(FP), R4 // 3e000014de8f1000c427c028
|
||||
MOVB y+4097(FP), R4 // 3e000014de8f1000c4270028
|
||||
MOVBU y+4097(FP), R4 // 3e000014de8f1000c427002a
|
||||
MOVW 65536(R5), R4 // 1e020014de971000c4038028
|
||||
MOVWU 65536(R5), R4 // 1e020014de971000c403802a
|
||||
MOVV 65536(R5), R4 // 1e020014de971000c403c028
|
||||
MOVB 65536(R5), R4 // 1e020014de971000c4030028
|
||||
MOVBU 65536(R5), R4 // 1e020014de971000c403002a
|
||||
MOVW 4096(R5), R4 // 3e000014de971000c4038028
|
||||
MOVWU 4096(R5), R4 // 3e000014de971000c403802a
|
||||
MOVV 4096(R5), R4 // 3e000014de971000c403c028
|
||||
MOVB 4096(R5), R4 // 3e000014de971000c4030028
|
||||
MOVBU 4096(R5), R4 // 3e000014de971000c403002a
|
||||
MOVW y+65540(FP), F4 // 1e020014de8f1000c433002b
|
||||
MOVF y+65540(FP), F4 // 1e020014de8f1000c433002b
|
||||
MOVD y+65540(FP), F4 // 1e020014de8f1000c433802b
|
||||
MOVW y+4097(FP), F4 // 3e000014de8f1000c427002b
|
||||
MOVF y+4097(FP), F4 // 3e000014de8f1000c427002b
|
||||
MOVD y+4097(FP), F4 // 3e000014de8f1000c427802b
|
||||
MOVW 65536(R5), F4 // 1e020014de971000c403002b
|
||||
MOVF 65536(R5), F4 // 1e020014de971000c403002b
|
||||
MOVD 65536(R5), F4 // 1e020014de971000c403802b
|
||||
MOVW 4096(R5), F4 // 3e000014de971000c403002b
|
||||
MOVF 4096(R5), F4 // 3e000014de971000c403002b
|
||||
MOVD 4096(R5), F4 // 3e000014de971000c403802b
|
||||
MOVW F4, result+65540(FP) // 1e020014de8f1000c433402b
|
||||
MOVF F4, result+65540(FP) // 1e020014de8f1000c433402b
|
||||
MOVD F4, result+65540(FP) // 1e020014de8f1000c433c02b
|
||||
MOVW F4, result+4097(FP) // 3e000014de8f1000c427402b
|
||||
MOVF F4, result+4097(FP) // 3e000014de8f1000c427402b
|
||||
MOVD F4, result+4097(FP) // 3e000014de8f1000c427c02b
|
||||
MOVW F4, 65536(R5) // 1e020014de971000c403402b
|
||||
MOVF F4, 65536(R5) // 1e020014de971000c403402b
|
||||
MOVD F4, 65536(R5) // 1e020014de971000c403c02b
|
||||
MOVW F4, 4096(R5) // 3e000014de971000c403402b
|
||||
MOVF F4, 4096(R5) // 3e000014de971000c403402b
|
||||
MOVD F4, 4096(R5) // 3e000014de971000c403c02b
|
||||
|
||||
MOVH R4, result+65540(FP) // 1e020014de8f1000c4334029
|
||||
MOVH R4, 65536(R5) // 1e020014de971000c4034029
|
||||
MOVH y+65540(FP), R4 // 1e020014de8f1000c4334028
|
||||
MOVH 65536(R5), R4 // 1e020014de971000c4034028
|
||||
MOVH R4, result+4097(FP) // 3e000014de8f1000c4274029
|
||||
MOVH R4, 4096(R5) // 3e000014de971000c4034029
|
||||
MOVH y+4097(FP), R4 // 3e000014de8f1000c4274028
|
||||
MOVH 4096(R5), R4 // 3e000014de971000c4034028
|
||||
MOVHU R4, result+65540(FP) // 1e020014de8f1000c4334029
|
||||
MOVHU R4, 65536(R5) // 1e020014de971000c4034029
|
||||
MOVHU y+65540(FP), R4 // 1e020014de8f1000c433402a
|
||||
MOVHU 65536(R5), R4 // 1e020014de971000c403402a
|
||||
MOVHU R4, result+4097(FP) // 3e000014de8f1000c4274029
|
||||
MOVHU R4, 4096(R5) // 3e000014de971000c4034029
|
||||
MOVHU y+4097(FP), R4 // 3e000014de8f1000c427402a
|
||||
MOVHU 4096(R5), R4 // 3e000014de971000c403402a
|
||||
SGT $74565, R4 // 5e020014de178d0384781200
|
||||
SGT $74565, R4, R5 // 5e020014de178d0385781200
|
||||
SGT $4097, R4 // 3e000014de07800384781200
|
||||
SGT $4097, R4, R5 // 3e000014de07800385781200
|
||||
SGTU $74565, R4 // 5e020014de178d0384f81200
|
||||
SGTU $74565, R4, R5 // 5e020014de178d0385f81200
|
||||
SGTU $4097, R4 // 3e000014de07800384f81200
|
||||
SGTU $4097, R4, R5 // 3e000014de07800385f81200
|
||||
ADDU $74565, R4 // 5e020014de178d0384781000
|
||||
ADDU $74565, R4, R5 // 5e020014de178d0385781000
|
||||
ADDU $4097, R4 // 3e000014de07800384781000
|
||||
ADDU $4097, R4, R5 // 3e000014de07800385781000
|
||||
ADDVU $4097, R4 // 3e000014de07800384f81000
|
||||
ADDVU $4097, R4, R5 // 3e000014de07800385f81000
|
||||
ADDVU $74565, R4 // 5e020014de178d0384f81000
|
||||
ADDVU $74565, R4, R5 // 5e020014de178d0385f81000
|
||||
OR $74565, R4 // 5e020014de178d0384781500
|
||||
OR $74565, R4, R5 // 5e020014de178d0385781500
|
||||
OR $4097, R4 // 3e000014de07800384781500
|
||||
OR $4097, R4, R5 // 3e000014de07800385781500
|
||||
XOR $74565, R4 // 5e020014de178d0384f81500
|
||||
XOR $74565, R4, R5 // 5e020014de178d0385f81500
|
||||
XOR $4097, R4 // 3e000014de07800384f81500
|
||||
XOR $4097, R4, R5 // 3e000014de07800385f81500
|
||||
8
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
8
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
@@ -21,9 +21,9 @@ label0:
|
||||
BEQ R1, 2(PC)
|
||||
JMP label0+0 // JMP 3 // 1000fffd
|
||||
BEQ R1, 2(PC)
|
||||
JAL 1(PC) // CALL 1(PC) // 0c00000f
|
||||
JAL 1(PC) // CALL 1(PC) // 0c00000e
|
||||
BEQ R1, 2(PC)
|
||||
JAL label0+0 // CALL 3 // 0c000007
|
||||
JAL label0+0 // CALL 3 // 0c000006
|
||||
|
||||
// LBRA addr
|
||||
// {
|
||||
@@ -32,11 +32,11 @@ label0:
|
||||
BEQ R1, 2(PC)
|
||||
JMP 0(R1) // JMP (R1) // 00200008
|
||||
BEQ R1, 2(PC)
|
||||
JMP foo+0(SB) // JMP foo(SB) // 08000019
|
||||
JMP foo+0(SB) // JMP foo(SB) // 08000018
|
||||
BEQ R1, 2(PC)
|
||||
JAL 0(R1) // CALL (R1) // 0020f809
|
||||
BEQ R1, 2(PC)
|
||||
JAL foo+0(SB) // CALL foo(SB) // 0c000021
|
||||
JAL foo+0(SB) // CALL foo(SB) // 0c000020
|
||||
|
||||
//
|
||||
// BEQ/BNE
|
||||
|
||||
75
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
75
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
@@ -24,7 +24,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVW $-32767, R5 // 38a08001
|
||||
MOVW $-32768, R6 // 38c08000
|
||||
MOVW $1234567, R5 // 6405001260a5d687
|
||||
MOVD 8(R3), R4 // e8830008
|
||||
MOVD 8(R3), R4 // e8830008
|
||||
MOVD (R3)(R4), R5 // 7ca4182a
|
||||
MOVW 4(R3), R4 // e8830006
|
||||
MOVW (R3)(R4), R5 // 7ca41aaa
|
||||
@@ -41,7 +41,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVDBR (R3)(R4), R5 // 7ca41c28
|
||||
MOVWBR (R3)(R4), R5 // 7ca41c2c
|
||||
MOVHBR (R3)(R4), R5 // 7ca41e2c
|
||||
MOVD $foo+4009806848(FP), R5 // 3ca1ef0138a5cc40
|
||||
MOVD $foo+4009806848(FP), R5 // 3ca1ef0138a5cc20
|
||||
MOVD $foo(SB), R5 // 3ca0000038a50000
|
||||
|
||||
MOVDU 8(R3), R4 // e8830009
|
||||
@@ -79,14 +79,14 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVBU R4, 1(R3) // 9c830001
|
||||
MOVBU R5, (R3)(R4) // 7ca419ee
|
||||
|
||||
MOVB $0, R4 // 38800000
|
||||
MOVBZ $0, R4 // 38800000
|
||||
MOVH $0, R4 // 38800000
|
||||
MOVHZ $0, R4 // 38800000
|
||||
MOVW $0, R4 // 38800000
|
||||
MOVWZ $0, R4 // 38800000
|
||||
MOVD $0, R4 // 38800000
|
||||
MOVD $0, R0 // 38000000
|
||||
MOVB $0, R4 // 38800000
|
||||
MOVBZ $0, R4 // 38800000
|
||||
MOVH $0, R4 // 38800000
|
||||
MOVHZ $0, R4 // 38800000
|
||||
MOVW $0, R4 // 38800000
|
||||
MOVWZ $0, R4 // 38800000
|
||||
MOVD $0, R4 // 38800000
|
||||
MOVD $0, R0 // 38000000
|
||||
|
||||
ADD $1, R3 // 38630001
|
||||
ADD $1, R3, R4 // 38830001
|
||||
@@ -351,18 +351,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
CRORN CR0GT, CR0EQ, CR0SO // 4c620b42
|
||||
CRXOR CR0GT, CR0EQ, CR0SO // 4c620982
|
||||
|
||||
ISEL $0, R3, R4, R5 // 7ca3201e
|
||||
ISEL $1, R3, R4, R5 // 7ca3205e
|
||||
ISEL $0, R3, R4, R5 // 7ca3201e
|
||||
ISEL $2, R3, R4, R5 // 7ca3209e
|
||||
ISEL $3, R3, R4, R5 // 7ca320de
|
||||
ISEL $4, R3, R4, R5 // 7ca3211e
|
||||
ISEL $31, R3, R4, R5 // 7ca327de
|
||||
ISEL CR0LT, R3, R4, R5 // 7ca3201e
|
||||
ISEL CR0GT, R3, R4, R5 // 7ca3205e
|
||||
ISEL CR0EQ, R3, R4, R5 // 7ca3209e
|
||||
ISEL CR0SO, R3, R4, R5 // 7ca320de
|
||||
ISEL CR1LT, R3, R4, R5 // 7ca3211e
|
||||
ISEL CR7SO, R3, R4, R5 // 7ca327de
|
||||
POPCNTB R3, R4 // 7c6400f4
|
||||
POPCNTW R3, R4 // 7c6402f4
|
||||
POPCNTD R3, R4 // 7c6403f4
|
||||
@@ -772,51 +765,9 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVFL R1, $3 // 7c203120
|
||||
|
||||
// Verify supported bdnz/bdz encodings.
|
||||
BC 16,0,0(PC) // BC $16, CR0LT, 0(PC) // 42000000
|
||||
BC 16,0,0(PC) // BC $16,R0,0(PC) // 42000000
|
||||
BDNZ 0(PC) // 42000000
|
||||
BDZ 0(PC) // 42400000
|
||||
BC 18,0,0(PC) // BC $18, CR0LT, 0(PC) // 42400000
|
||||
|
||||
// Verify the supported forms of bcclr[l]
|
||||
BC $20,CR0LT,$1,LR // 4e800820
|
||||
BC $20,CR0LT,$0,LR // 4e800020
|
||||
BC $20,CR0LT,LR // 4e800020
|
||||
BC $20,CR0GT,LR // 4e810020
|
||||
BC 20,CR0LT,LR // BC $20,CR0LT,LR // 4e800020
|
||||
BC 20,undefined_symbol,LR // BC $20,CR0LT,LR // 4e800020
|
||||
BC 20,undefined_symbol+1,LR // BC $20,CR0GT,LR // 4e810020
|
||||
JMP LR // 4e800020
|
||||
BR LR // JMP LR // 4e800020
|
||||
BCL $20,CR0LT,$1,LR // 4e800821
|
||||
BCL $20,CR0LT,$0,LR // 4e800021
|
||||
BCL $20,CR0LT,LR // 4e800021
|
||||
BCL $20,CR0GT,LR // 4e810021
|
||||
BCL 20,CR0LT,LR // BCL $20,CR0LT,LR // 4e800021
|
||||
BCL 20,undefined_symbol,LR // BCL $20,CR0LT,LR // 4e800021
|
||||
BCL 20,undefined_symbol+1,LR // BCL $20,CR0GT,LR // 4e810021
|
||||
|
||||
// Verify the supported forms of bcctr[l]
|
||||
BC $20,CR0LT,CTR // 4e800420
|
||||
BC $20,CR0GT,CTR // 4e810420
|
||||
BC 20,CR0LT,CTR // BC $20,CR0LT,CTR // 4e800420
|
||||
BC 20,undefined_symbol,CTR // BC $20,CR0LT,CTR // 4e800420
|
||||
BC 20,undefined_symbol+1,CTR // BC $20,CR0GT,CTR // 4e810420
|
||||
JMP CTR // 4e800420
|
||||
BR CTR // JMP CTR // 4e800420
|
||||
BCL $20,CR0LT,CTR // 4e800421
|
||||
BCL $20,CR0GT,CTR // 4e810421
|
||||
BCL 20,CR0LT,CTR // BCL $20,CR0LT,CTR // 4e800421
|
||||
BCL 20,undefined_symbol,CTR // BCL $20,CR0LT,CTR // 4e800421
|
||||
BCL 20,undefined_symbol+1,CTR // BCL $20,CR0GT,CTR // 4e810421
|
||||
|
||||
// Verify bc encoding (without pic enabled)
|
||||
BC $16,CR0LT,0(PC) // 42000000
|
||||
BCL $16,CR0LT,0(PC) // 42000001
|
||||
BC $18,CR0LT,0(PC) // 42400000
|
||||
|
||||
MOVD SPR(3), 4(R1) // 7fe302a6fbe10004
|
||||
MOVD XER, 4(R1) // 7fe102a6fbe10004
|
||||
MOVD 4(R1), SPR(3) // ebe100047fe303a6
|
||||
MOVD 4(R1), XER // ebe100047fe103a6
|
||||
BC 18,0,0(PC) // BC $18,R0,0(PC) // 42400000
|
||||
|
||||
RET
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package flags
|
||||
|
||||
import (
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/objabi"
|
||||
"flag"
|
||||
"fmt"
|
||||
@@ -24,7 +23,7 @@ var (
|
||||
Linkshared = flag.Bool("linkshared", false, "generate code that will be linked against Go shared libraries")
|
||||
AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
|
||||
SymABIs = flag.Bool("gensymabis", false, "write symbol ABI information to output file, don't assemble")
|
||||
Importpath = flag.String("p", obj.UnlinkablePkg, "set expected package import to path")
|
||||
Importpath = flag.String("p", "", "set expected package import to path")
|
||||
Spectre = flag.String("spectre", "", "enable spectre mitigations in `list` (all, ret)")
|
||||
CompilingRuntime = flag.Bool("compiling-runtime", false, "source to be compiled is part of the Go runtime")
|
||||
)
|
||||
|
||||
@@ -53,11 +53,6 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// <= go 1.7 doesn't embed the contentID or actionID, so no slash is present
|
||||
if !strings.Contains(id, "/") {
|
||||
log.Fatalf("%s: build ID is a legacy format...binary too old for this tool", file)
|
||||
}
|
||||
|
||||
newID := id[:strings.LastIndex(id, "/")] + "/" + buildid.HashToString(hash)
|
||||
if len(newID) != len(id) {
|
||||
log.Fatalf("%s: build ID length mismatch %q vs %q", file, id, newID)
|
||||
|
||||
@@ -753,16 +753,6 @@ presented to cmd/link as part of a larger program, contains:
|
||||
_go_.o # gc-compiled object for _cgo_gotypes.go, _cgo_import.go, *.cgo1.go
|
||||
_all.o # gcc-compiled object for _cgo_export.c, *.cgo2.c
|
||||
|
||||
If there is an error generating the _cgo_import.go file, then, instead
|
||||
of adding _cgo_import.go to the package, the go tool adds an empty
|
||||
file named dynimportfail. The _cgo_import.go file is only needed when
|
||||
using internal linking mode, which is not the default when linking
|
||||
programs that use cgo (as described below). If the linker sees a file
|
||||
named dynimportfail it reports an error if it has been told to use
|
||||
internal linking mode. This approach is taken because generating
|
||||
_cgo_import.go requires doing a full C link of the package, which can
|
||||
fail for reasons that are irrelevant when using external linking mode.
|
||||
|
||||
The final program will be a dynamic executable, so that cmd/link can avoid
|
||||
needing to process arbitrary .o files. It only needs to process the .o
|
||||
files generated from C files that cgo writes, and those are much more
|
||||
|
||||
@@ -488,7 +488,7 @@ func (p *Package) guessKinds(f *File) []*Name {
|
||||
// Check if compiling the preamble by itself causes any errors,
|
||||
// because the messages we've printed out so far aren't helpful
|
||||
// to users debugging preamble mistakes. See issue 8442.
|
||||
preambleErrors := p.gccErrors([]byte(builtinProlog + f.Preamble))
|
||||
preambleErrors := p.gccErrors([]byte(f.Preamble))
|
||||
if len(preambleErrors) > 0 {
|
||||
error_(token.NoPos, "\n%s errors for preamble:\n%s", gccBaseCmd[0], preambleErrors)
|
||||
}
|
||||
@@ -576,23 +576,8 @@ func (p *Package) loadDWARF(f *File, conv *typeConv, names []*Name) {
|
||||
switch e.Tag {
|
||||
case dwarf.TagVariable:
|
||||
name, _ := e.Val(dwarf.AttrName).(string)
|
||||
// As of https://reviews.llvm.org/D123534, clang
|
||||
// now emits DW_TAG_variable DIEs that have
|
||||
// no name (so as to be able to describe the
|
||||
// type and source locations of constant strings
|
||||
// like the second arg in the call below:
|
||||
//
|
||||
// myfunction(42, "foo")
|
||||
//
|
||||
// If a var has no name we won't see attempts to
|
||||
// refer to it via "C.<name>", so skip these vars
|
||||
//
|
||||
// See issue 53000 for more context.
|
||||
if name == "" {
|
||||
break
|
||||
}
|
||||
typOff, _ := e.Val(dwarf.AttrType).(dwarf.Offset)
|
||||
if typOff == 0 {
|
||||
if name == "" || typOff == 0 {
|
||||
if e.Val(dwarf.AttrSpecification) != nil {
|
||||
// Since we are reading all the DWARF,
|
||||
// assume we will see the variable elsewhere.
|
||||
@@ -826,7 +811,6 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
|
||||
|
||||
params := name.FuncType.Params
|
||||
args := call.Call.Args
|
||||
end := call.Call.End()
|
||||
|
||||
// Avoid a crash if the number of arguments doesn't match
|
||||
// the number of parameters.
|
||||
@@ -974,7 +958,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
|
||||
if nu {
|
||||
needsUnsafe = true
|
||||
}
|
||||
sb.WriteString(gofmtPos(m, end))
|
||||
sb.WriteString(gofmtLine(m))
|
||||
|
||||
sb.WriteString("(")
|
||||
for i := range params {
|
||||
@@ -1638,8 +1622,6 @@ func (p *Package) gccMachine() []string {
|
||||
} else if gomips == "softfloat" {
|
||||
return []string{"-mabi=32", "-msoft-float"}
|
||||
}
|
||||
case "loong64":
|
||||
return []string{"-mabi=lp64d"}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -1831,23 +1813,6 @@ func (p *Package) gccDebug(stdin []byte, nnames int) (d *dwarf.Data, ints []int6
|
||||
bo := f.ByteOrder
|
||||
symtab, err := f.Symbols()
|
||||
if err == nil {
|
||||
// Check for use of -fsanitize=hwaddress (issue 53285).
|
||||
removeTag := func(v uint64) uint64 { return v }
|
||||
if goarch == "arm64" {
|
||||
for i := range symtab {
|
||||
if symtab[i].Name == "__hwasan_init" {
|
||||
// -fsanitize=hwaddress on ARM
|
||||
// uses the upper byte of a
|
||||
// memory address as a hardware
|
||||
// tag. Remove it so that
|
||||
// we can find the associated
|
||||
// data.
|
||||
removeTag = func(v uint64) uint64 { return v &^ (0xff << (64 - 8)) }
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for i := range symtab {
|
||||
s := &symtab[i]
|
||||
switch {
|
||||
@@ -1855,10 +1820,9 @@ func (p *Package) gccDebug(stdin []byte, nnames int) (d *dwarf.Data, ints []int6
|
||||
// Found it. Now find data section.
|
||||
if i := int(s.Section); 0 <= i && i < len(f.Sections) {
|
||||
sect := f.Sections[i]
|
||||
val := removeTag(s.Value)
|
||||
if sect.Addr <= val && val < sect.Addr+sect.Size {
|
||||
if sect.Addr <= s.Value && s.Value < sect.Addr+sect.Size {
|
||||
if sdat, err := sect.Data(); err == nil {
|
||||
data := sdat[val-sect.Addr:]
|
||||
data := sdat[s.Value-sect.Addr:]
|
||||
ints = make([]int64, len(data)/8)
|
||||
for i := range ints {
|
||||
ints[i] = int64(bo.Uint64(data[i*8:]))
|
||||
@@ -1870,10 +1834,9 @@ func (p *Package) gccDebug(stdin []byte, nnames int) (d *dwarf.Data, ints []int6
|
||||
// Found it. Now find data section.
|
||||
if i := int(s.Section); 0 <= i && i < len(f.Sections) {
|
||||
sect := f.Sections[i]
|
||||
val := removeTag(s.Value)
|
||||
if sect.Addr <= val && val < sect.Addr+sect.Size {
|
||||
if sect.Addr <= s.Value && s.Value < sect.Addr+sect.Size {
|
||||
if sdat, err := sect.Data(); err == nil {
|
||||
data := sdat[val-sect.Addr:]
|
||||
data := sdat[s.Value-sect.Addr:]
|
||||
floats = make([]float64, len(data)/8)
|
||||
for i := range floats {
|
||||
floats[i] = math.Float64frombits(bo.Uint64(data[i*8:]))
|
||||
@@ -1886,10 +1849,9 @@ func (p *Package) gccDebug(stdin []byte, nnames int) (d *dwarf.Data, ints []int6
|
||||
// Found it. Now find data section.
|
||||
if i := int(s.Section); 0 <= i && i < len(f.Sections) {
|
||||
sect := f.Sections[i]
|
||||
val := removeTag(s.Value)
|
||||
if sect.Addr <= val && val < sect.Addr+sect.Size {
|
||||
if sect.Addr <= s.Value && s.Value < sect.Addr+sect.Size {
|
||||
if sdat, err := sect.Data(); err == nil {
|
||||
data := sdat[val-sect.Addr:]
|
||||
data := sdat[s.Value-sect.Addr:]
|
||||
strdata[n] = string(data)
|
||||
}
|
||||
}
|
||||
@@ -1900,10 +1862,9 @@ func (p *Package) gccDebug(stdin []byte, nnames int) (d *dwarf.Data, ints []int6
|
||||
// Found it. Now find data section.
|
||||
if i := int(s.Section); 0 <= i && i < len(f.Sections) {
|
||||
sect := f.Sections[i]
|
||||
val := removeTag(s.Value)
|
||||
if sect.Addr <= val && val < sect.Addr+sect.Size {
|
||||
if sect.Addr <= s.Value && s.Value < sect.Addr+sect.Size {
|
||||
if sdat, err := sect.Data(); err == nil {
|
||||
data := sdat[val-sect.Addr:]
|
||||
data := sdat[s.Value-sect.Addr:]
|
||||
strlen := bo.Uint64(data[:8])
|
||||
if strlen > (1<<(uint(p.IntSize*8)-1) - 1) { // greater than MaxInt?
|
||||
fatalf("string literal too big")
|
||||
@@ -2263,8 +2224,6 @@ var dwarfToName = map[string]string{
|
||||
"long long unsigned int": "ulonglong",
|
||||
"signed char": "schar",
|
||||
"unsigned char": "uchar",
|
||||
"unsigned long": "ulong", // Used by Clang 14; issue 53013.
|
||||
"unsigned long long": "ulonglong", // Used by Clang 14; issue 53013.
|
||||
}
|
||||
|
||||
const signedDelta = 64
|
||||
@@ -2551,11 +2510,6 @@ func (c *typeConv) loadType(dtype dwarf.Type, pos token.Pos, parent string) *Typ
|
||||
t.Go = name // publish before recursive calls
|
||||
goIdent[name.Name] = name
|
||||
if dt.ByteSize < 0 {
|
||||
// Don't override old type
|
||||
if _, ok := typedef[name.Name]; ok {
|
||||
break
|
||||
}
|
||||
|
||||
// Size calculation in c.Struct/c.Opaque will die with size=-1 (unknown),
|
||||
// so execute the basic things that the struct case would do
|
||||
// other than try to determine a Go representation.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user