1
0
mirror of https://github.com/golang/go synced 2024-10-03 06:21:21 -06:00
Commit Graph

17540 Commits

Author SHA1 Message Date
Austin Clements
506615d83e runtime: factor object dumping code out of greyobject
When checkmark fails, greyobject dumps both the object that pointed to
the unmarked object and the unmarked object. This code cluttered up
greyobject, was copy-pasted for the two objects, and the copy for
dumping the unmarked object was not entirely correct.

Extract object dumping out to a new function. This declutters
greyobject and fixes the bugs in dumping the unmarked object. The new
function is slightly cleaned up from the original code to have more
natural control flow and shows a marker on the field in the base
object that points to the unmarked object to make it easy to find.

Change-Id: Ib51318a943f50b0b99995f0941d03ee8876b9fcf
Reviewed-on: https://go-review.googlesource.com/7506
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-03-17 01:46:35 +00:00
Austin Clements
830abc957a runtime: fix out of date comment
scanobject no longer returns the new wbuf.

Change-Id: I0da335ae5cd7ef7ea0e0fa965cf0e9f3a650d0e6
Reviewed-on: https://go-review.googlesource.com/7505
Reviewed-by: Rick Hudson <rlh@golang.org>
2015-03-17 01:46:20 +00:00
Russ Cox
e5be6432a8 cmd/internal/gc: mv builtins builtin
This directory is processed by mkbuiltin.go and generates builtin.go.
It should be named builtin too, not builtins, both for consistency
and because file and directory names in general are singular unless
forced otherwise.

Commented on CL 6233 too.

Change-Id: Ic5d3671443ae9292b69fda118f61a11c88d823fa
Reviewed-on: https://go-review.googlesource.com/7660
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-17 01:28:13 +00:00
Russ Cox
1fdd1d181b cmd/6g: make proginfo register bits constants
Also replace proginfo call with cheaper calls where only flags are needed.

Change-Id: Ib6e5c12bd8752b87c0d8bcf22fa9e25e04a7941f
Reviewed-on: https://go-review.googlesource.com/7630
Reviewed-by: Rob Pike <r@golang.org>
2015-03-17 01:24:40 +00:00
Russ Cox
00b3b40b07 cmd/internal/obj/x86: minor optimization
- avoid copy in range ytab
- add fast path to prefixof

Change-Id: I88aa9d91a0abe80d253f7c3bca950b4613297499
Reviewed-on: https://go-review.googlesource.com/7628
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-17 01:21:20 +00:00
Russ Cox
c8198344ef cmd/internal/gc: fmt.Sprintf elimination and minor cleanup
Change-Id: Iaf5a7d25e6308b32c17a38afbbd46befa17aa3a4
Reviewed-on: https://go-review.googlesource.com/7629
Reviewed-by: Rob Pike <r@golang.org>
2015-03-17 01:20:31 +00:00
Russ Cox
d7f6d46c5c cmd/...: remove use of func() { ... }() in loop increment
These were introduced during C -> Go translation when the loop increment
contained multiple statements.

Change-Id: Ic8abd8dcb3308851a1f7024de00711f0f984e684
Reviewed-on: https://go-review.googlesource.com/7627
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-17 00:34:00 +00:00
Russ Cox
01512b3edb cmd/internal/gc: add -d disablenil debug option to turn off nil checks
Change-Id: I18f2e2ee141ebb65a8579ee1e440cb9c2069ef86
Reviewed-on: https://go-review.googlesource.com/7626
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-17 00:33:46 +00:00
Russ Cox
13f9c8b08e cmd/gc: rewrite argtype to substitute in a single pass
Substituting in multiple passes meant walking the type
multiple times, and worse, if a complex type was substituted
in an early pass, later passes would follow it, possibly recursively,
until hitting the depth 10 limit.

Change-Id: Ie61d6ec08438e297baabe932afe33d08f358e55f
Reviewed-on: https://go-review.googlesource.com/7625
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-17 00:33:15 +00:00
Russ Cox
5fca39967d cmd/dist: show reason for command failure
Change-Id: I9fb5c1c11a750766ae2d9532869d5ab26f1cf9cf
Reviewed-on: https://go-review.googlesource.com/7624
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-03-17 00:30:50 +00:00
Russ Cox
861546543a cmd/internal/obj: reimplement line history
In addition to possibly being clearer code,
this replaces an O(n) lookup with an O(log n) lookup.

Change-Id: I0a574c536a965a87f7ad6dcdcc30f737bc771cd5
Reviewed-on: https://go-review.googlesource.com/7623
Reviewed-by: Rob Pike <r@golang.org>
2015-03-17 00:30:37 +00:00
Joël Stemmer
ebe3d693d4 crypto/tls: return correct hash function when using client certificates in handshake
Commit f1d669aee9 added support for
AES_256_GCM_SHA384 cipher suites as specified in RFC5289. However, it
did not take the arbitrary hash function into account in the TLS client
handshake when using client certificates.

The hashForClientCertificate method always returned SHA256 as its
hashing function, even if it actually used a different one to calculate
its digest. Setting up the connection would eventually fail with the
error "tls: failed to sign handshake with client certificate:
crypto/rsa: input must be hashed message".

Included is an additional test for this specific situation that uses the
SHA384 hash.

Fixes #9808

Change-Id: Iccbf4ab225633471ef897907c208ad31f92855a3
Reviewed-on: https://go-review.googlesource.com/7040
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-03-16 23:38:51 +00:00
Nick Sullivan
0a048ce5e9 crypto/rsa: implement crypto.Decrypter
Decrypter is an interface to support opaque private keys that perform
decryption operations. This interface is analogous to the crypto.Signer
interface.

This change introduces the crypto.Decrypter interface and implements
the crypto.Decrypter interface for rsa.PrivateKey with both OAEP and
PKCS#1 v1.5 padding modes.

Change-Id: I433f649f84ed3c2148337d735cafd75f1d94a904
Reviewed-on: https://go-review.googlesource.com/3900
Reviewed-by: Adam Langley <agl@golang.org>
2015-03-16 23:15:08 +00:00
Russ Cox
fa97136038 cmd/internal/obj: add basic test of line history
Change-Id: Ic22e004b43bd98e712befb30684be16d8214c94a
Reviewed-on: https://go-review.googlesource.com/7622
Reviewed-by: Rob Pike <r@golang.org>
2015-03-16 23:07:28 +00:00
Russ Cox
049eee6806 cmd/internal/obj: use map for symbol table
Change-Id: I105c1e7730c1e7ccf36297b9cbf96dc0a4868013
Reviewed-on: https://go-review.googlesource.com/7621
Reviewed-by: Rob Pike <r@golang.org>
2015-03-16 23:07:22 +00:00
Russ Cox
8e2a57e643 cmd/pprof/internal/profile: insert blank line after non-doc comment
Change-Id: I91fe72c60d6c41644780474620e05380e9af2a3d
Reviewed-on: https://go-review.googlesource.com/7620
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-16 23:07:15 +00:00
Rob Pike
5764befa5a text/template: protect against explicit nil in field chains
An explicit nil in an expression like nil.Foo caused a panic
because the evaluator attempted to reflect on the nil.
A typeless nil like this cannot be used to do anything, so
just error out.

Fixes #9426

Change-Id: Icd2c9c7533dda742748bf161eced163991a12f54
Reviewed-on: https://go-review.googlesource.com/7643
Reviewed-by: David Symonds <dsymonds@golang.org>
2015-03-16 22:35:49 +00:00
Josh Bleecher Snyder
e2ca3e6c0f cmd/internal/gc: remove dead code
Change-Id: Id5ce859bd4b6318dc9104f7377ae23d7f0bc30cd
Reviewed-on: https://go-review.googlesource.com/7640
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-16 19:43:12 +00:00
Aram Hăvărneanu
76a2ee3bcd cmd/objdump: disable TestDisasm.* on arm64
ARM64 doesn't have disassembler yet.

Change-Id: I016fa013b5ff50dc49d38ade42351b79be023d80
Reviewed-on: https://go-review.googlesource.com/7149
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:46:52 +00:00
Aram Hăvărneanu
a25e3c03f3 os/signal, hash/crc32: add arm64 build tags
Change-Id: I6ca9caec8ccf12618e56dcf6b83328e7acf8b1ec
Reviewed-on: https://go-review.googlesource.com/7148
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:46:43 +00:00
Aram Hăvărneanu
1abd8185b2 reflect: add support for GOARCH=arm64
Change-Id: I033eecff5e5838ba677378ac884bf5f29267e880
Reviewed-on: https://go-review.googlesource.com/7146
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:46:27 +00:00
Aram Hăvărneanu
2a0833da50 sync/atomic: add support for GOARCH=arm64
Change-Id: I11cd4b5e8daf3805af0eaa83b55b20da889702f4
Reviewed-on: https://go-review.googlesource.com/7145
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:46:18 +00:00
Aram Hăvărneanu
f0aef42ea1 math, math/big: add support for GOARCH=arm64
Change-Id: Ief12e1435a40dd2eaddc3f97f63be44c4dd2e050
Reviewed-on: https://go-review.googlesource.com/7144
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:46:10 +00:00
Aram Hăvărneanu
d0d9310df9 syscall: add support for GOARCH=arm64
Change-Id: Ia817e78d9678a365a76fea5e4dbe8f8a5aab0bac
Reviewed-on: https://go-review.googlesource.com/7143
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:46:02 +00:00
Aram Hăvărneanu
846ee0465b runtime: add support for linux/arm64
Change-Id: Ibda6a5bedaff57fd161d63fc04ad260931d34413
Reviewed-on: https://go-review.googlesource.com/7142
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:45:54 +00:00
Aram Hăvărneanu
5a0c322bce cmd/dist: add support for GOARCH=arm64
Change-Id: I92b4301b64054272d78dd15c16bf6ff592acad26
Reviewed-on: https://go-review.googlesource.com/7141
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-16 18:45:45 +00:00
Aram Hăvărneanu
3ab794c8c6 cmd/cgo: add support for GOARCH=arm64
Change-Id: Ia6c3d5e7a32b20e3c45d9485e66b48cd02644280
Reviewed-on: https://go-review.googlesource.com/7140
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:45:35 +00:00
Aram Hăvărneanu
02c1a9d87d cmd/7g: add ARM64 Go compiler, based on 9g
No peep optimizer yet.

Change-Id: Ifa5f993cd6ac5e34783c0df41faf772fbce96ae2
Reviewed-on: https://go-review.googlesource.com/7049
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:45:26 +00:00
Aram Hăvărneanu
3d1ce27ba5 cmd/7l: add the ARM64 linker
Only internal linking without cgo is supported for now.

Change-Id: I91eb1572c1ccc805db62fc4c29080df98797d51a
Reviewed-on: https://go-review.googlesource.com/7048
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:45:16 +00:00
Aram Hăvărneanu
18d9ddc35c cmd/asm: add support for ARM64
Pre/post-index addressing modes with writeback use .W and .P
instruction suffixes, like on ARM.

Complex addressing modes are not supported yet.

Change-Id: I537a1c3fe5b057c0812662677d0010bc8c468ffb
Reviewed-on: https://go-review.googlesource.com/7047
Reviewed-by: Rob Pike <r@golang.org>
2015-03-16 18:45:08 +00:00
Aram Hăvărneanu
26bbe7ac9b cmd/internal/obj, cmd/internal/obj/arm64: add support for GOARCH=arm64
ARM64 (ARMv8) has 32 general purpose, 64-bit integer registers
(R0-R31), 32 64-bit scalar floating point registers (F0-F31), and
32 128-bit vector registers (unused, V0-V31).

R31 is either the stack pointer (RSP), or the zero register (ZR),
depending on the instruction. Note the distinction between the
hardware stack pointer, RSP, and the virtual stack pointer SP.

The (hardware) stack pointer must be 16-byte aligned at all times;
the RSP register itself must be aligned, offset(RSP) only has to
have natural alignment.

Instructions are fixed-width, and are 32-bit wide. ARM64 supports
ARMv7 too (32-bit ARM), but not in the same process. In general,
there is not much in common between 32-bit ARM and ARM64, it's a
new architecture.

All implementations have floating point instructions.

This change adds a Prog.To3 field analogous to Prog.To. It is used
by exclusive load/store instructions such as STLXR which read from
one register, and write to both a register and a memory address.

	STLXRW	R1, (R0), R3

This will store the word contained in R1 to the memory address
pointed by R0. R3 will be updated with the status result of the
store. It is used to implement atomic operations.

No other changes are made to the portable Prog and Addr structures.

Change-Id: Ie839029aa5265bbad35769d9689eca11e1c48c47
Reviewed-on: https://go-review.googlesource.com/7046
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-16 18:44:57 +00:00
Aram Hăvărneanu
25e213752b cmd/go: disable verifyAsm for arm64
ARM64 doesn't have the old assembler.

Change-Id: I9253271029440e2b7f2813d3e98a7d2e7a65bfbc
Reviewed-on: https://go-review.googlesource.com/7045
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-16 18:44:47 +00:00
Aram Hăvărneanu
272921b5d8 go/build: add GOARCH=arm64
Change-Id: I51db032e3dc2762d94e4000914b30813946250f7
Reviewed-on: https://go-review.googlesource.com/7044
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2015-03-16 18:44:35 +00:00
Joel Sing
6900a421a4 sync/atomic: add support for openbsd/arm
Change-Id: I45383de6d627be35f40e07a9008b6773f5c2b0d0
Reviewed-on: https://go-review.googlesource.com/7613
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-15 09:12:45 +00:00
Joel Sing
6ed6cb4550 cmd/dist: use GOARM=5 for openbsd/arm
OpenBSD/arm only currently supports softfloat, hence make the default GOARM=5.

Change-Id: Ie3e8f457f001b3803d17ad9bc4ab957b2da18c6a
Reviewed-on: https://go-review.googlesource.com/7614
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-15 09:11:56 +00:00
Joel Sing
550149fb04 syscall: add support for openbsd/arm
Change-Id: I9fe15781f52e0d16707a9c021cf800319721a606
Reviewed-on: https://go-review.googlesource.com/4913
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-15 04:07:54 +00:00
Joel Sing
be3133bfda runtime: add support for openbsd/arm
Change-Id: I2bc101aa19172e705ee4de5f3c73a8b4bbf4fa6f
Reviewed-on: https://go-review.googlesource.com/4912
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-15 04:06:26 +00:00
Shenghou Ma
d7e3d69e1c runtime: skip TestStdcallAndCDeclCallbacks when gcc is missing
Fixes #10167.

Change-Id: Ib6c6b2b5dde47744b69f65482a21964fa3c12090
Reviewed-on: https://go-review.googlesource.com/7600
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-03-15 00:37:05 +00:00
Joel Sing
3b1d692093 all: remove dragonfly/386 port
DragonFlyBSD dropped support for i386 in 4.0 and there is no longer a
dragonfly/386 - as such, remove the Go port.

Fixes #8951
Fixes #7580
Fixes #7421

Change-Id: I69022ab2262132e8f97153f14dc8c37c98527008
Reviewed-on: https://go-review.googlesource.com/7543
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Joel Sing <jsing@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-03-14 10:47:19 +00:00
Josh Bleecher Snyder
facd79e4be encoding/binary: cull dead code
Change-Id: I91f9b5280e08e005f5a891aaa249267c211d814b
Reviewed-on: https://go-review.googlesource.com/7592
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-14 02:51:22 +00:00
Ian Lance Taylor
5158147e24 debug/elf: support reading debug info from 32-bit PPC objects
Fixes #10118.

Change-Id: I4a2e6748db609c6eed1d68c824b81c59bd7b875c
Reviewed-on: https://go-review.googlesource.com/7590
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-14 01:31:28 +00:00
Ian Lance Taylor
6e3cf70e68 debug/gosym: fix typo in comment
Change-Id: Ieb13359c5bbe26bbf7baaaa8eb63d5e90bdefdd8
Reviewed-on: https://go-review.googlesource.com/7591
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-14 01:28:30 +00:00
Michael Hudson-Doyle
8c3cc58d0c cmd/internal/ld: remove some dead code
Just little bits and pieces I noticed were unused in passing, and
some more found with https://github.com/opennota/check.

Change-Id: I199fecdbf8dc2ff9076cf4ea81395275c7f171c3
Reviewed-on: https://go-review.googlesource.com/7033
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-14 01:04:25 +00:00
Matthew Dempsky
d6dfb0295b cmd/internal/gc: remove unused fields
Change-Id: I3096a7497955bc475739739ee23be387e9162867
Reviewed-on: https://go-review.googlesource.com/7210
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-14 01:03:54 +00:00
Robert Griesemer
23fd374bf2 math/big: wrap Float.Cmp result in struct to prevent wrong use
Float.Cmp used to return a value < 0, 0, or > 0 depending on how
arguments x, y compared against each other. With the possibility
of NaNs, the result was changed into an Accuracy (to include Undef).
Consequently, Float.Cmp results could still be compared for (in-)
equality with 0, but comparing if < 0 or > 0 would provide the
wrong answer w/o any obvious notice by the compiler.

This change wraps Float.Cmp results into a struct and accessors
are used to access the desired result. This prevents incorrect
use.

Change-Id: I34e6a6c1859251ec99b5cf953e82542025ace56f
Reviewed-on: https://go-review.googlesource.com/7526
Reviewed-by: Rob Pike <r@golang.org>
2015-03-14 00:48:53 +00:00
Mikio Hara
b100216441 syscall: add missing Syscall9 for darwin/amd64
Fixes #10068.

Change-Id: I1f12225ee16b0090b87403931c0bc0157f068309
Reviewed-on: https://go-review.googlesource.com/6555
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-14 00:21:11 +00:00
Matthew Dempsky
8b3670ffc6 cmd/internal/gc: remove namebuf variable
namebuf was a global char buffer in the C version of gc, which was
useful for providing common storage for constructing symbol and file
names.  However, now that it's just a global Go string and the string
data is dynamically allocated anyway, it doesn't serve any purpose
except to force extra write barriers everytime it's assigned to.

Also, introduce Lookupf(fmt, args...) as shorthand for
Lookup(fmt.Sprintf(fmt, args...)), which was a very common pattern for
using namebuf.

Passes "go build -toolexec 'toolstash -cmp' -a std".

Notably, this CL shrinks 6g's text section by ~15kB:

$ size toolstash/6g tool/linux_amd64/6g
   text	   data	    bss	    dec	    hex	filename
4600805	 605968	 342988	5549761	 54aec1	toolstash/6g
4585547	 605968	 342956	5534471	 547307	tool/linux_amd64/6g

Change-Id: I98abb44fc7f43a2e2e48425cc9f215cd0be37442
Reviewed-on: https://go-review.googlesource.com/7080
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-13 23:35:11 +00:00
Dave Cheney
211df1de12 cmd/7g: fix build breakage
Update cmd/7g to match the other compilers. Fixes build break in rev 6582d1cf8.

Change-Id: I449613cf348254e9de6cc7a6b7737e43ea7d10fe
Reviewed-on: https://go-review.googlesource.com/7580
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-03-13 23:07:00 +00:00
Michael Hudson-Doyle
6582d1cf8b cmd/internal/gc, etc: remove canemitecode of Naddr
The argument is never consulted apart from passing it to recursive
calls.  So delete it.

Change-Id: Ia15eefb6385b3c99ea4def88f564f4e5a94c68ab
Reviewed-on: https://go-review.googlesource.com/7032
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-13 22:56:42 +00:00
Robert Griesemer
a4bfe64f00 math/big: fix minor documentation issue
Change-Id: Ib42f75c03573cec16801b79a6eb9b1b542028f4f
Reviewed-on: https://go-review.googlesource.com/7524
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-13 21:30:11 +00:00
Robert Griesemer
f6580319e4 math/big: fix silly bug in Int64 accessor
Change-Id: If335d45ea1ab6c8aeeb47515f97680e2c1d651f3
Reviewed-on: https://go-review.googlesource.com/7522
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-13 20:14:57 +00:00
Nigel Tao
3eb84c8908 image/jpeg: reject bad Tq values in SOF data.
Fixes #10154

Change-Id: Ibb8ea9bcf512e7639c57a6f17afbe4495fa329cd
Reviewed-on: https://go-review.googlesource.com/7494
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-13 05:22:55 +00:00
Joel Sing
f076ad893b runtime: remove reference to openbsd kern.rthreads sysctl
The kern.rthreads sysctl has not existed for a long time - there is no way to
disable rthreads and __tfork no longer returns ENOTSUP.

Change-Id: Ia50ff01ac86ea83358e72b8f45f7818aaec1e4b1
Reviewed-on: https://go-review.googlesource.com/7490
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-13 02:51:33 +00:00
Joel Sing
4feee8c659 cmd/5l: make 5l work on openbsd
Change-Id: If58ea50fbf321ae943d0890a40e0552e7bc19709
Reviewed-on: https://go-review.googlesource.com/2080
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-13 02:51:12 +00:00
Andrew Gerrand
1f35bb6466 archive/zip: remove WriterOptions and replace with SetOffset method
Change-Id: I0a8b972c33e80c750ff1d63717177a5a3294a112
Reviewed-on: https://go-review.googlesource.com/7445
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Geert-Johan Riemer <gjr19912@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-12 21:32:09 +00:00
Robert Griesemer
8a6eca43df math/big: handle NaNs in Float.Cmp
Also:
- Implemented NewFloat convenience factory function (analogous to
  NewInt and NewRat).
- Implemented convenience accessors for Accuracy values returned
  from Float.Cmp.
- Added test and example.

Change-Id: I985bb4f86e6def222d4b2505417250d29a39c60e
Reviewed-on: https://go-review.googlesource.com/6970
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-12 18:56:25 +00:00
Russ Cox
d022266a9a flag: use four spaces before tab, not three
Four spaces is what works well for both 4- and 8-space tab stops.

Screen with fixed-width font and 4-space tab stops:
http://imgur.com/lps5Lbb

Change-Id: I7d2b813d674c3e0a68f79d63bc5d5ec5bd4f87bb
Reviewed-on: https://go-review.googlesource.com/7503
Reviewed-by: Rob Pike <r@golang.org>
2015-03-12 18:43:06 +00:00
Robert Griesemer
363617c7d3 math/big: added (internal) Float.form field for easier case distinctions
This is a fairly significant _internal_ representation change. Instead
of encoding 0, finite, infinite, and NaN values with special mantissa
and exponent values, a new (1 byte) 'form' field is used (without making
the Float struct bigger). The form field permits simpler and faster
case distinctions. As a side benefit, for zero and non-finite floats,
fewer fields need to be set. Also, the exponent range is not the full
int32 range (in the old format, infExp and nanExp were used to represent
Inf and NaN values and tests for those values sometimes didn't test
for the empty mantissa, so the range was reduced by 2 values).

The correspondence between the old and new fields is as follows.
Old representation:

x                 neg      mant         exp
---------------------------------------------------------------
+/-0              sign     empty        0
0 < |x| < +Inf    sign     mantissa     exponent
+/-Inf            sign     empty        infExp
NaN               false    empty        nanExp

New representation (- stands for ignored fields):

x                 neg      mant         exp         form
---------------------------------------------------------------
+/-0              sign     -            -           zero
0 < |x| < +Inf    sign     mantissa     exponent    finite
+/-Inf            sign     -            -           inf
NaN               -        -            -           nan

Client should not be affected by this change.

Change-Id: I7e355894d602ceb23f9ec01da755fe6e0386b101
Reviewed-on: https://go-review.googlesource.com/6870
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-12 18:41:45 +00:00
Robert Griesemer
0ff7c3ea45 math/big: make validate a method of Float (cleanup)
Change-Id: If38f45acffd352ed95f32f3a36edd91a1fb33d0c
Reviewed-on: https://go-review.googlesource.com/6850
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-12 18:34:42 +00:00
Robert Griesemer
63269404a8 math/big: introduce Bits abstraction instead of using "untyped" []int bit lists
Change-Id: I6caa6bdcf6643ce3015244397a752bd133f3d00c
Reviewed-on: https://go-review.googlesource.com/6840
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-03-12 18:31:21 +00:00
Rob Pike
51d66601c4 flag: nicer usage messages
Make PrintDefaults print an easier-to-read format, and allow the user
to control it a bit by putting a hint into the usage string.

Here is the new doc comment for PrintDefaults, which does the work:

    PrintDefaults prints, to standard error unless configured otherwise, a
    usage message showing the default settings of all defined command-line
    flags. For an integer valued flag x, the default output has the form

	-x int
		usage-message-for-x (default 7)

    The usage message will appear on a separate line except for single-
    letter boolean flags. Boolean flags omit the type, since they can be
    used without an actual value, and the parenthetical default is omitted
    if the default is the zero value for the type. The type, here int, can
    be replaced by a string of the user's choosing by placing in the usage
    string for the flag a back-quoted name; the first such item in the
    message is taken to be a parameter name to show in the message and the
    back quotes are stripped from the message when displayed. For instance,
    given

	flag.String("I", "", "search `directory` for include files")

    the output will be

	-I directory
		search directory for include files.

Given

	A = flag.Bool("A", false, "for bootstrapping, allow 'any' type")
	B = flag.Bool("Alongflagname", false, "disable bounds checking")
	C = flag.Bool("C", true, "a boolean defaulting to true")
	D = flag.String("D", "", "set relative `path` for local imports")
	F = flag.Float64("F", 2.7, "a non-zero float")
	G = flag.Float64("G", 0, "a float that defaults to zero")
	N = flag.Int("N", 27, "a non-zero int")
	Z = flag.Int("Z", 0, "an int that defaults to zero")
	T = flag.Duration("deltaT", 0, "a duration")

the old output was

  -A=false: for bootstrapping, allow 'any' type
  -Alongflagname=false: disable bounds checking
  -C=true: a boolean defaulting to true
  -D="": set relative `path` for local imports
  -F=2.7: a non-zero float
  -G=0: a float that defaults to zero
  -N=27: a non-zero int
  -Z=0: an int that defaults to zero
  -deltaT=0: a duration

and the new output is

  -A	for bootstrapping, allow 'any' type
  -Alongflagname
	disable bounds checking
  -C	a boolean defaulting to true (default true)
  -D path
   	set relative path for local imports
  -F float
   	a non-zero float (default 2.7)
  -G float
   	a float that defaults to zero
  -N int
   	a non-zero int (default 27)
  -Z int
   	an int that defaults to zero
  -deltaT duration
   	a duration

Change-Id: I54ab3cd5610d551422b004d95ab78305e06a395d
Reviewed-on: https://go-review.googlesource.com/7330
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-12 18:20:35 +00:00
Rob Pike
6d0e87afe6 cmd/asm: add MRC and MCR to end-to-end test for arm
The old, per-architecture operand printers didn't lock down the
format of the constant in the MRC and MCR instructions (a value
that could be presented more helpfully - maybe how the
input looks? - but that is an issue for another day). But there is
a portable standard printer now so we can enable tests for these
instructions.

Change-Id: I437a3b112ce63f4d6e1fe3450fc21d8c3372602f
Reviewed-on: https://go-review.googlesource.com/7420
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-12 18:03:04 +00:00
Michael Hudson-Doyle
c9089e64be cmd/asm/internal/asm: report arch if assembly fails
Just a trivial thing I noticed in passing.

Change-Id: I875069ceffd623f9e430d07feb5042ab9e69917e
Reviewed-on: https://go-review.googlesource.com/7472
Reviewed-by: Rob Pike <r@golang.org>
2015-03-12 14:00:43 +00:00
Michael Hudson-Doyle
14fbec49dc cmd/internal/obj/x86: implement -shared computation of TLS base
Somehow, terribly embarrassingly, I lost part of the "re-enable
-shared on amd64" patch when rebasing before it got submitted.
This restores it and also fixes the addend to be the necessary -4.

Now updated so that Git will not put the new case into the wrong
switch.

Change-Id: I1d628232771a6d6ce6d085adf379f94a377822c5
Reviewed-on: https://go-review.googlesource.com/7126
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-12 03:18:21 +00:00
Matt Joiner
4f489f59c2 net/http/pprof: Use relative links to profiles in index html
This allows /debug/pprof/ and descendents to be used through
http.StripPrefix and other path rewriting handlers.

Change-Id: I53673876c107bbfaf430123ead78e6524b42ac21
Reviewed-on: https://go-review.googlesource.com/7351
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-12 01:13:26 +00:00
Geert-Johan Riemer
de573f8748 archive/zip: add NewWriterWithOptions
When appending zip data to existing data such as a binary file the
zip headers must use the correct offset. NewWriterWithOptions
allows creating a Writer that uses the provided offset in the zip
headers.

Fixes #8669

Change-Id: I6ec64f1e816cc57b6fc8bb9e8a0918e586fc56b0
Reviewed-on: https://go-review.googlesource.com/2978
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-12 00:13:29 +00:00
Shenghou Ma
0d6a0d6c3f runtime: don't return a slice with nil ptr but non-zero len from growslice
Fixes #10135.

Change-Id: Ic4c5ab15bcb7b9c3fcc685a788d3b59c60c26e1e
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7400
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-12 00:08:38 +00:00
Shenghou Ma
1e1c9dc2c8 cmd/9g: use REGZERO instead of REG_R0 if we want the zero register
This will make the intention clearer.
This is migrated from pre-c2go CL 4930.

Change-Id: I9103126a05323daedd729a43b94b2be8cd7408c9
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7410
Reviewed-by: Austin Clements <austin@google.com>
2015-03-12 00:08:20 +00:00
Austin Clements
9dfbcd8fac debug/dwarf: factor parsing of unit lengths
Many headers in DWARF sections have a "unit length" that can be either
4 bytes or 12 bytes and indicates both the length of the unit and
whether the unit is in 32-bit or 64-bit format.

Currently, we implement unit length parsing in four different places.
Add a "unitLength" method to buf that parses a unit length and use it
in these four places.

Change-Id: I7950b91caaa92aa5e19aa63debc8ae46178ecc4d
Reviewed-on: https://go-review.googlesource.com/7281
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-11 21:35:21 +00:00
Matthew Dempsky
d533e3955d cmd/internal/ld: fix package data parsing
The conversion of this logic from C introduced a few subtle behavior
changes.  E.g., assigning "name := data[p0:]" and then "name =
name[:p1-p0]" actually caused name to span the vast majority of the
package data, as at the time of the second statement p0 points just
after the package name and p1 points to the end of the package data.

Similarly, the logic for advancing past the newline at the end of the
package line changed slightly: for a "package foo safe" line, the new
code would only advance up to the newline, but not past.  (Albeit, in
practice this doesn't matter: newlines in package data are harmless.)

Lastly, "data[p0]" was incorrectly written as "data[0]" a few times.

Change-Id: I49017e16ba33a627f773532b418cbf85a84f2b4b
Reviewed-on: https://go-review.googlesource.com/7000
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-11 21:28:51 +00:00
Hyang-Ah (Hana) Kim
eb96bb1992 path/filepath: clarify the package doc about '/' in returned results.
The slash is replaced with os.PathSeparator before returning.
Split, SplitList are the exceptions; comments for them mention this.

Fixes golang/go#10122.

Change-Id: I66dbee8d09f378582e046be8df309a3930151820
Reviewed-on: https://go-review.googlesource.com/7310
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-11 20:25:35 +00:00
Keith Randall
cd5b144d98 runtime,reflect,cmd/internal/gc: Fix comments referring to .c/.h files
Everything has moved to Go, but comments still refer to .c/.h files.
Fix all of those up, at least for these three directories.

Fixes #10138

Change-Id: Ie5efe89b247841e0b3f82aac5256b2c606ef67dc
Reviewed-on: https://go-review.googlesource.com/7431
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-11 20:19:43 +00:00
Rob Pike
4b981ed3e6 cmd/internal/obj/*: go generate the slice of Anames strings
Add cmd/internal/obj/stringer.go to do the generation and update
the architecture packages to use it to maintain the Anames tables.

Change-Id: I9c6d4def1bf21624668396d70c17973d0db11fbc
Reviewed-on: https://go-review.googlesource.com/7430
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-11 20:13:09 +00:00
Rob Pike
5d987f1513 cmd/asm: implement MCR instruction on ARM
It's an oddball that needs special treatment because it is not really
an opcode, but a variant of MRC.

The String method of Prog still needs updating to print it nicely.

Change-Id: I6005b7f2234ccd3d4ac1f658948e3be97cf1f1c2
Reviewed-on: https://go-review.googlesource.com/7220
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-03-11 17:22:03 +00:00
Dmitry Vyukov
7b0c73aa28 cmd/trace: move goroutine analysis code to internal/trace
This allows to test goroutine analysis code in runtime/pprof tests.
Also fix a nil-deref crash in goroutine analysis code that happens on runtime/pprof tests.

Change-Id: Id7884aa29f7fe4a8d7042482a86fe434e030461e
Reviewed-on: https://go-review.googlesource.com/7301
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-11 12:53:24 +00:00
Dmitry Vyukov
9d332a8324 cmd/trace: dump thread id on proc start
Augment ProcStart events with OS thread id.
This helps in scheduler locality analysis.

Change-Id: I93fea75d3072cf68de66110d0b59d07101badcb5
Reviewed-on: https://go-review.googlesource.com/7302
Reviewed-by: Keith Randall <khr@golang.org>
2015-03-11 12:52:41 +00:00
Matthew Dempsky
b2843becab cmd/yacc/testdata/expr: fix handling of negative numbers
Fixes #10129.

Change-Id: I9f56c483726f14b6c1909740549de236d5bf9cfb
Reviewed-on: https://go-review.googlesource.com/7340
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-11 04:20:42 +00:00
Dave Cheney
e498181942 cmd/internal/gc: more Node cleanups
More cleanups to gc.Node

- make Node.Local a boolean
- make Type.Local a boolean
- reduce the size of Node.Esc to a uint8

Reducing the size of Node.Esc shaves ~45mb off the RSS compiling cmd/internal/gc on amd64

before:
        Maximum resident set size (kbytes): 659496
after:
        Maximum resident set size (kbytes): 612196

- declare gc.Funcdepth as int32
- declare Node.Funcdepth as int32

In both cases, these were previously machine specific int types. This doesn't result in
any memory saving at the moment due to struct padding.

Change-Id: Iabef8da15e962fe8b79d7fd3d402fb26ce7ec31c
Reviewed-on: https://go-review.googlesource.com/7261
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-03-11 02:58:03 +00:00
Dave Cheney
b353a69509 debug/elf: fix arm build
This change adds the minimum necessary to implement applyRelocations.

For adg, this code uses the switch statement.

Change-Id: I0989daab8d0e36c2a4f6a315ced258b832744616
Reviewed-on: https://go-review.googlesource.com/7266
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-11 01:37:57 +00:00
Nigel Tao
782db7fc88 image/jpeg: support chroma hv values other than 0x11.
The testdata was generated by:
convert video-001.png tmp1.tga
cjpeg -quality 100 -sample 2x2,1x2,1x2 tmp1.tga > video-001.221212.jpeg
djpeg -nosmooth -targa video-001.221212.jpeg > tmp2.tga
convert tmp2.tga video-001.221212.png
rm tmp1.tga tmp2.tga

Change-Id: Ica241dfc19b3eb47ade150bf0432373c6006c38a
Reviewed-on: https://go-review.googlesource.com/7264
Reviewed-by: Rob Pike <r@golang.org>
2015-03-11 00:10:09 +00:00
Dave Cheney
532bc5f11c syscall: exec_linux.go: support platforms without SYS_DUP2
Updates #9974

This change is in preparation for merging the arm64 platform.

Arm64 does not support SYS_DUP2 at all, so define a new constant to be
the minimum dup(2) version supported. This constant defaults to SYS_DUP2
on all existing platforms.

Change-Id: If405878105082c7c880f8541c1491970124c9ce4
Reviewed-on: https://go-review.googlesource.com/7123
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-03-10 22:52:09 +00:00
Shenghou Ma
f00c19add5 cmd/7g, cmd/7l, cmd/go: copy 9g/9l to 7g/7l, and build as tools
Kick start the upstreaming of the arm64 port. The only manual
change is cmd/go/pkg.go.

Change-Id: I0607ad045486f0998c4e21654b59276ca5348069
Reviewed-on: https://go-review.googlesource.com/7075
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-03-10 18:52:12 +00:00
Robert Griesemer
d7e043eaf5 go/ast: fixed minor typo in comment
Fixes #10125.

Change-Id: I99032912650cef8e5bf124bda0a60d5899760103
Reviewed-on: https://go-review.googlesource.com/7320
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-10 16:40:15 +00:00
Dmitry Vyukov
5471e02338 runtime/pprof: fix trace test
Some of the trace stacks are OS-dependent due to OS-specific code
in net package. Check these stacks only on subset of OSes.

Change-Id: If95e4485839f4120fd6395725374c3a2f8706dfc
Reviewed-on: https://go-review.googlesource.com/7300
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2015-03-10 16:29:25 +00:00
Rick Hudson
d0eab03091 runtime: Adjust when write barriers are active
Even though the world is stopped the GC may do pointer
writes that need to be protected by write barriers.
This means that the write barrier must be on
continuously from the time the mark phase starts and
the mark termination phase ends. Checks were added to
ensure that no allocation happens during a GC.

Hoist the logic that clears pools the start of the GC
so that the memory can be reclaimed during this GC cycle.

Change-Id: I9d1551ac5db9bac7bac0cb5370d5b2b19a9e6a52
Reviewed-on: https://go-review.googlesource.com/6990
Reviewed-by: Austin Clements <austin@google.com>
2015-03-10 15:04:12 +00:00
Dmitry Vyukov
919fd24884 runtime: remove runtime frames from stacks in traces
Stip uninteresting bottom and top frames from trace stacks.
This makes both binary and json trace files smaller,
and also makes stacks shorter and more readable in the viewer.

Change-Id: Ib9c80ccc280504f0e235f867f53f1d2652c41583
Reviewed-on: https://go-review.googlesource.com/5523
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
2015-03-10 14:46:15 +00:00
Austin Clements
fdd49d2be0 debug/dwarf: add unit tests for line table reader
This adds simple ELF test binaries generated by gcc and clang and
compares the line tables returned by the line table reader against
tables based on the output of readelf.

The binaries were generated with
    # gcc --version | head -n1
    gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
    # gcc -g -o line-gcc.elf line*.c

    # clang --version | head -n1
    Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
    # clang -g -o line-clang.elf line*.c

Change-Id: Id210fdc1d007ac9719e8f5dc845f2b94eed12234
Reviewed-on: https://go-review.googlesource.com/7070
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-10 02:32:48 +00:00
Austin Clements
3393009267 debug/dwarf: add support for line tables
This implements a LineReader for line tables that parallels the
existing Reader for debug entries.

This code is partly based on the debug subrepo's fork of dwarf, but it
is a more complete (and, I believe, correct) implementation of the
spec and exposes a more general API.  While the debug subrepo's
implementation exposed only a PC-to-line function, this version
exposes the line table rows to the caller.  This way the caller can
make its own trade-offs when implementing PC-to-line (or line-to-PC),
such as whether or not to build an index for fast lookup.

Change-Id: Ie157bc817f55e940b6f2e1ae010c5a4e1f29c5c8
Reviewed-on: https://go-review.googlesource.com/6734
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-03-10 02:32:42 +00:00
Austin Clements
0e31b4ed26 debug/dwarf: factor finding unit containing entry offset
This factors out the code for finding which unit contains an offset in
the "info" section.  The new code also replaces linear search with a
binary search.  The line table reader will also need this
functionality.

Change-Id: I2076e4fc6719b6f06fd2796cbbc7548ec1876cb3
Reviewed-on: https://go-review.googlesource.com/6733
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-10 02:32:37 +00:00
Austin Clements
de1693f984 debug/macho, debug/pe: load DWARF line section and pass to dwarf.New
Change-Id: I1e6c6b3e2984528c0331e17755cc057e7199193e
Reviewed-on: https://go-review.googlesource.com/7071
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-10 02:32:31 +00:00
Austin Clements
29ad1ae420 debug/elf: load .debug_line section and pass to dwarf.New
Change-Id: Ia6f9bd77a3d4250339dcb054edc76942864dd358
Reviewed-on: https://go-review.googlesource.com/6781
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-10 02:32:25 +00:00
Austin Clements
4ee347b0ad debug/elf: regularize DWARF section loading
Previously, different DWARF sections had relocations applied in very
different ways.  .debug_info was relocated, but only on x86-64 and 386
and using hard-coded relocation section names instead of relocation
links.  .debug_abbrev and .debug_str were never relocated (which is
excusable because they shouldn't need it).  .debug_types sections were
relocated on all architectures and found their relocation section
using a relocation link because section names could be ambiguous.

Simplify all of this so that every DWARF section that has a linked
relocation section gets those relocations applied.

This prepares this code to load .debug_line sections without the need
for yet more ad hoc relocation logic.

Change-Id: Ia00ac8e656b22f22bb31a5f6ef9b0f23cda64d19
Reviewed-on: https://go-review.googlesource.com/6780
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-03-10 02:32:19 +00:00
Nigel Tao
cc009687bc image/jpeg: support RGB JPEG images.
The testdata was generated by:
convert video-001.png tmp1.tga
cjpeg -rgb -sample 2x2,1x1,1x1 tmp1.tga > video-001.rgb.jpeg
djpeg -nosmooth -targa video-001.rgb.jpeg > tmp2.tga
convert tmp2.tga video-001.rgb.png
rm tmp1.tga tmp2.tga

Change-Id: I5da0591b9005c1c75e807311f157d385e0e20a38
Reviewed-on: https://go-review.googlesource.com/6910
Reviewed-by: Rob Pike <r@golang.org>
2015-03-09 23:18:33 +00:00
Dave Cheney
d328756a69 cmd/internal/gc: make Node.Isddd boolean
Convert Node.Isddd to a boolean and simplify usage.

- Node.Isddd converted to bool
- Type.Isddd converted to bool
- mkinlcall converted to take isddd as a bool
- typecheckaste converted to take isddd as a bool
- ascompatte converted to take isddd as a bool

Change-Id: I52586145619c44182bb0c2c5d80a0a3fe3e50a07
Reviewed-on: https://go-review.googlesource.com/7172
Reviewed-by: Keith Randall <khr@golang.org>
2015-03-09 20:56:16 +00:00
David Crawshaw
402f71a839 runtime: do not share underlying envs/argv array
Removes a potential data race between os.Setenv and runtime.GOROOT,
along with a bug where os.Setenv would only sometimes change the
value of runtime.GOROOT.

Change-Id: I7d2a905115c667ea6e73f349f3784a1d3e8f810d
Reviewed-on: https://go-review.googlesource.com/6611
Reviewed-by: Keith Randall <khr@golang.org>
2015-03-09 17:25:23 +00:00
David Crawshaw
ac080fa6d8 net: skip unixgram tests on darwin/arm
Change-Id: I9d2c84237f7b1c4dc2e53adf249b7518dda81a21
Reviewed-on: https://go-review.googlesource.com/7165
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-03-09 15:34:32 +00:00
David Crawshaw
9b8ad3fde2 sync/atomic: skip test on darwin/arm
Updates #7338.

Change-Id: I859a73543352dbdd13ec05efb23a95aecbcc628a
Reviewed-on: https://go-review.googlesource.com/7164
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-03-09 14:10:25 +00:00
Roger Peppe
9f9d66d3b6 encoding/xml: fix default namespace of tags
The struct XMLName sets the default namespace, but
that's not good enough for nested tags, because an
earlier tag can set the implicit parents of a subsequent
tag. This change makes sure that we always explicitly set the
namespace on a tag when possible.

See https://go-review.googlesource.com/#/c/5910/4/src/encoding/xml/marshal_test.go@628
for discussion.

Change-Id: If1afc536471c0be83e5dd80381b598476ea3f44d
Reviewed-on: https://go-review.googlesource.com/6927
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-03-09 09:10:30 +00:00
Dave Cheney
44e903158f cmd/internal/gc: more Node cleanups
More Node cleanups, these ones touch go.y.

- convert Node.Implicit to bool
- convert Node.Used to bool

Change-Id: I85c7ff9e66cee7122b560adedc995166c874f2f2
Reviewed-on: https://go-review.googlesource.com/7124
Reviewed-by: Keith Randall <khr@golang.org>
2015-03-09 05:01:14 +00:00
Dave Cheney
42c8be4414 go/build: disable cgo by default for freebsd/arm
Updates #10119

Temporarily disable cgo by default to get the freebsd/arm
builder running again.

Change-Id: I4de1f896fcac650184df77c692b102ea6fb73bba
Reviewed-on: https://go-review.googlesource.com/7125
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-09 00:42:05 +00:00