The spec mostly uses the term embedded.
It's too late to change the field name but at least fix the docs.
Fixes#4514.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7235080
Impossible for us to check (without sleazily reaching into the
runtime) but at least document it.
Fixes#3800.
R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7268043
Change the stack unwinding code to compensate for the dynamic
relocation of symbols.
Change the gc instruction GC_CALL to use a relative offset instead of
an absolute address.
R=golang-dev
CC=golang-dev
https://golang.org/cl/7248048
Everybody either gets confused and thinks this is
TrimLeft/TrimRight or does this by hand which gets
repetitive looking.
R=rsc, kevlar
CC=golang-dev
https://golang.org/cl/7239044
* Separate internal and external LockOSThread, for cgo safety.
* Show goroutine that made faulting cgo call.
* Never start a panic due to a signal caused by a cgo call.
Fixes#3774.
Fixes#3775.
Fixes#3797.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7228081
Cut out temporary cgo file in error message.
Show C.foo instead of _Ctype_foo.
Before:
x.go:20[/var/folders/00/05_b8000h01000cxqpysvccm000n9d/T/go-build242036121/command-line-arguments/_obj/x.cgo1.go:19]: cannot use tv.Usec (type int32) as type _Ctype___darwin_suseconds_t in assignment
After:
x.go:20: cannot use tv.Usec (type int32) as type C.__darwin_suseconds_t in assignment
Fixes#4255.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7231075
The old version was using go/ast's CommentGroup.Text method,
but that method drops leading blank lines from the result, so that
if the comment looked like one of
//
// syntax error
import "C"
/*
syntax error
*/
import "C"
then the line numbers for the syntax error would be off by the
number of leading blank lines (1 in each of the above cases).
The new text extractor preserves blank lines.
Fixes#4019.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7232071
The Unix and Plan 9 readfile call breset(b) but Windows was not,
leaving dregs in the buffer.
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/7229069
If runtime's proc.c does not compile, cmd/dist used to show
the compile errors in a sea of acid output, making them impossible
to find. Change the command invocation to write the acid output
to a file, so that the errors are the only thing shown on failure.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7221082
A step toward a fix for issue 4069.
To allow linking with arbitrary host object files, add a linker mode
that can generate a host object file instead of an executable.
Then the host linker can be invoked to generate the final executable.
This CL adds a new -hostobj flag that instructs the linker to write
a host object file instead of an executable.
That is, this works:
go tool 6g x.go
go tool 6l -hostobj -o x.o x.6
ld -e _rt0_amd64_linux x.o
./a.out
as does:
go tool 8g x.go
go tool 8l -hostld ignored -o x.o x.8
ld -m elf_i386 -e _rt0_386_linux x.o
./a.out
Because 5l was never updated to use the standard relocation scheme,
it will take more work to get this working on ARM.
This is a checkpoint of the basic functionality. It does not work
with cgo yet, and cgo is the main reason for the change.
The command-line interface will likely change too.
The gc linker has other information that needs to be returned to
the caller for use when invoking the host linker besides the single
object file.
R=iant, iant
CC=golang-dev
https://golang.org/cl/7060044
This is a backwards compatible API change that fixes broken code.
In Go 1.0, ReadFull(r, buf) could return either len(buf), nil or len(buf), non-nil.
Most code expects only the former, so do that and document the guarantee.
Code that was correct before is still correct.
Code that was incorrect before, by assuming the guarantee, is now correct too.
The same applies to ReadAtLeast.
Fixes#4544.
R=golang-dev, bradfitz, minux.ma
CC=golang-dev
https://golang.org/cl/7235074
Someone found software that generates negative numbers for the RSA
modulus in an X.509 certificate. Our error messages were very poor in
this case so this change improves that.
Update #4728
Return more helpful errors when RSA parameters are negative or zero.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7228072
* Reject import paths of the form cmd/x/y.
* Reject 'go install' of command outside GOPATH
* Clearer error rejecting 'go install' of package outside GOPATH.
* Name temporary binary for first file in 'go run' list or for test.
* Provide a way to pass -ldflags arguments with spaces.
* Pass all Go files (even +build ignored ones) to go fix, go fmt, go vet.
* Reject 'go run foo_test.go'.
* Silence 'exit 1' prints from 'go tool' invocations.
* Make go test -xxxprofile leave binary behind for analysis.
* Reject ~ in GOPATH except on Windows.
* Get a little less confused by symlinks.
* Document that go test x y z runs three test binaries.
* Fix go test -timeout=0.
* Add -tags flag to 'go list'.
* Use pkg/gccgo_$GOOS_$GOARCH for gccgo output.
Fixes#3389.
Fixes#3500.
Fixes#3503.
Fixes#3760.
Fixes#3941.
Fixes#4007.
Fixes#4032.
Fixes#4074.
Fixes#4127.
Fixes#4140.
Fixes#4311.
Fixes#4568.
Fixes#4576.
Fixes#4702.
R=adg
CC=golang-dev
https://golang.org/cl/7225074
The linker accepts MOVB involving non-byte-addressable
registers, by generating XCHG instructions to AX or BX.
It does not handle the case where nor AX nor BX are available.
See also revision 1470920a2804.
Assembling
TEXT ·Truc(SB),7,$0
MOVB BP, (BX)(AX*1)
RET
gives before:
08048c60 <main.Truc>:
8048c60: 87 dd xchg %ebx,%ebp
8048c62: 88 1c 03 mov %bl,(%ebx,%eax,1)
8048c65: 87 dd xchg %ebx,%ebp
8048c67: c3 ret
and after:
08048c60 <main.Truc>:
8048c60: 87 cd xchg %ecx,%ebp
8048c62: 88 0c 03 mov %cl,(%ebx,%eax,1)
8048c65: 87 cd xchg %ecx,%ebp
8048c67: c3 ret
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7226066
This adds a simple IntHeap example, and modifies the more complex
PriorityQueue example to make use of the index field it maintains.
Fixes#4331.
R=rsc, adg
CC=golang-dev
https://golang.org/cl/7068048
ICU and collate package: ICU requires strings to be in FCD form.
Not all NFC strings are in this form, leading to incorrect results.
Change to NFD instead.
R=rsc
CC=golang-dev
https://golang.org/cl/7201043
Export data was broken after revision 6b602ab487d6
when -l is specified at least 3 times: it makes the compiler
write out func (*T).Method() declarations in export data, which
is not supported.
Also fix the formatting of recover() in export data. It was
not treated like panic() and was rendered as "<node RECOVER>".
R=golang-dev, lvd, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7067051