1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:28:33 -06:00
Commit Graph

25 Commits

Author SHA1 Message Date
Eric Engestrom
7a8caf7d43 all: fix spelling mistakes
Signed-off-by: Eric Engestrom <eric@engestrom.ch>

Change-Id: I91873aaebf79bdf1c00d38aacc1a1fb8d79656a7
Reviewed-on: https://go-review.googlesource.com/21433
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-03 17:03:15 +00:00
Joe Tsai
897dcdb5ec debug/elf: deflake file_test.go
It is valid for io.Reader to return (n, io.EOF) where n is positive.
The unit test should not fail if io.EOF is returned when read until
the end.

Change-Id: I7b918e3cc03db8b90c8aa58f4c0f7806a1d4af7e
Reviewed-on: https://go-review.googlesource.com/21307
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-30 06:56:25 +00:00
Michael Munday
12fb62a57d debug/elf: add s390x relocations
Change-Id: I8440f69c7f99d65b2f69035c26b4a62104f22bd3
Reviewed-on: https://go-review.googlesource.com/20874
Reviewed-by: Minux Ma <minux@golang.org>
2016-03-29 16:48:09 +00:00
Caleb Spare
139fad21b9 all: zero mtimes in testdata gz files
Fixes #14937.

Change-Id: Iea11a32230d44d5a43f8aec812d25f13bce85895
Reviewed-on: https://go-review.googlesource.com/21038
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-25 04:02:36 +00:00
Ian Lance Taylor
d1b8871f13 debug/dwarf: add Reader.SeekPC and Data.Ranges
These new methods help find the compilation unit to pass to the
LineReader method in order to find the line information for a PC.
The Ranges method also helps identify the specific function for a PC,
needed to determine the function name.

This uses the .debug.ranges section if necessary, and changes the object
file format packages to pass in the section contents if available.

Change-Id: I5ebc3d27faaf1a126ffb17a1e6027efdf64af836
Reviewed-on: https://go-review.googlesource.com/20769
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-22 14:06:09 +00:00
Brad Fitzpatrick
5fea2ccc77 all: single space after period.
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions. This means contributors won't be confused by
misleading precedence.

This CL doesn't use go/doc to parse. It only addresses // comments.
It was generated with:

$ perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')
$ go test go/doc -update

Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
Reviewed-on: https://go-review.googlesource.com/20022
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-02 00:13:47 +00:00
Brad Fitzpatrick
519474451a all: make copyright headers consistent with one space after period
This is a subset of https://golang.org/cl/20022 with only the copyright
header lines, so the next CL will be smaller and more reviewable.

Go policy has been single space after periods in comments for some time.

The copyright header template at:

    https://golang.org/doc/contribute.html#copyright

also uses a single space.

Make them all consistent.

Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0
Reviewed-on: https://go-review.googlesource.com/20111
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-01 23:34:33 +00:00
Austin Clements
ea5b9d5bd3 debug/elf: rename Chdr64.Reserved to _
This future-proofs the Chdr64 structure against later versions of ELF
defining this field and declutters the documentation without changing
the layout of the struct.

This structure does not exist in the current release, so this change
is safe.

Change-Id: I239aad7243ddaf063a1f8cd521d8a50b30413281
Reviewed-on: https://go-review.googlesource.com/18028
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-12-18 20:41:26 +00:00
Austin Clements
7648387705 debug/elf: transparently decompress compressed sections
This adds support for compressed ELF sections. This compression is
treated as a framing issue and hence the package APIs all
transparently decompress compressed sections. This requires some
subtlety for (*Section).Open, which returns an io.ReadSeeker: since
the decompressed data comes from an io.Reader, this commit introduces
a Reader-to-ReadSeeker adapter that is efficient for common uses of
Seek and does what it can otherwise.

Fixes #11773.

Change-Id: Ic0cb7255a85cadf4c1d15fb563d5a2e89dbd3c36
Reviewed-on: https://go-review.googlesource.com/17341
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2015-12-03 20:53:11 +00:00
Austin Clements
e1544d3bb6 dwbug/elf: support old-style compressed DWARF
GCC and LLVM support zlib-compressing DWARF debug sections (and
there's some evidence that this may be happening by default in some
circumstances now).

Add support for reading compressed DWARF sections. Since ELF
relocations apply to the decompressed data, decompression is done
before applying relocations. Since relcations are applied by
debug/elf, decompression must also be handled there.

Note that this is different from compressed ELF sections, which is a
more general mechanism used by very recent versions of GCC.

Updates #11773.

Change-Id: I3f4bf1b04d0802cc1e8fcb7c2a5fcf6c467c5089
Reviewed-on: https://go-review.googlesource.com/17340
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-12-03 20:53:04 +00:00
Yao Zhang
7ff52e13cd debug/elf: added MIPS ELF relocations
Change-Id: I05352749a852095baae2f67fd71ffcf5f727538d
Reviewed-on: https://go-review.googlesource.com/14453
Reviewed-by: Minux Ma <minux@golang.org>
2015-11-12 04:50:32 +00:00
Andrew Gerrand
b8efc006f2 all: remove executable bit from several files
Change-Id: Iab669b2a9dd0510c0e54f9ec1cbe2b83b991bceb
Reviewed-on: https://go-review.googlesource.com/14283
Reviewed-by: Minux Ma <minux@golang.org>
2015-09-04 02:59:49 +00:00
Didier Spezia
8286f18b94 debug/elf: map/slice literals janitoring
Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Reformatted some expressions to improve readability.

Change-Id: Iaf123e6bd49162ec45c59297ad3b002ca59443bc
Reviewed-on: https://go-review.googlesource.com/13850
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-08-25 01:36:11 +00:00
Matthew Dempsky
a01d90744f all: cleanup usage of dashes in package documentation
Change-Id: I58453f7ed71eaca15dd3f501e4ae88d1fab19908
Reviewed-on: https://go-review.googlesource.com/12683
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-07-28 02:44:41 +00:00
Ian Lance Taylor
61cd48b1ce debug/elf: change R_ARM_REL32 to R_ARM_ABS32 in applyRelocationsARM
The original version of applyRelocationsARM was added in
http://golang.org/cl/7266.  It was added to fix the ARM build, which
had been broken by http://golang.org/cl/6780.

Before CL 6780, there was no relocation processing for ARM.  CL 6780
changed the code to require relocation processing for every supported
target.  CL 7266 fixed the ARM build by adding a relocation processing
function, but in fact no actual processing was done.  The code only
looked for REL32 relocations, but ARM debug info has no such
relocations.  The test case added in CL 7266 doesn't have any either.

This didn't matter because no relocation processing was required on
ARM, at least not for GCC-generated debug info.  GCC generates ABS32
relocations, but only against section symbols which have the value 0.
Therefore, the addition done by correct handling of ABS32 doesn't
change anything.

Clang, however, generates ABS32 relocations against local symbols,
some of which have non-zero values.  For those, we need to handle
ABS32 relocations.

This patch corrects the CL 7266 to look for ABS32 relocations instead
of REL32 relocations.  The code was already written to correctly
handle ABS32 relocations, it just mistakenly said REL32.

This is the ARM equivalent of https://golang.org/cl/96680045, which
fixed the same problem in the same way for clang on 386.

With this patch, clang-3.5 can be used to build Go on ARM GNU/Linux.

Fixes #8980.

Change-Id: I0c2d72eadfe6373bde99cd03eee40de6a582dda1
Reviewed-on: https://go-review.googlesource.com/11222
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2015-06-26 16:17:54 +00:00
Austin Clements
d7d1337368 debug/dwarf: add DWARF attribute value class to Field
To return DWARF attribute values, debug/dwarf maps the DWARF attribute
value classes to Go types. Unfortunately, this mapping is ambiguous in
a way that makes it impossible to correctly interpret some DWARF
attributes as of DWARF 4. For example, AttrStartScope can be either a
constant or a rangelistptr. The attribute is interpreted differently
depending on its class, but debug/dwarf maps both classes to int64, so
the caller can't distinguish them from the Go type.
AttrDataMemberLocation is similar.

To address this, this change adds a field to type Field that indicates
the exact DWARF attribute value class of that field's value. This
makes it possible to distinguish value classes that can't be
distinguished by their Go type alone.

The root of this type ambiguity was DWARF itself. For example, DWARF 2
made no distinction between constants that were just constants and
constants that were section offsets because no attribute could have
both meanings. Hence, the single int64 type was sufficient. To avoid
introducing just another layer of ambiguity, this change takes pains
to canonicalize ambiguous classes in DWARF 2 and 3 files into the
unambiguous classes of DWARF 4.

Of course, there's no guarantee that future DWARF versions won't do
the same thing again and further subdivide the DWARF 4 classes. This
change gets ahead of this somewhat by distinguishing the various *ptr
classes even though the encoding does not. If there's some other form
of split, we can handle this in a backwards-compatible way by
introducing, for example, a Class5 field and type.

Change-Id: I4ef96d1223b0fd7f96ecf44fcc0e704a36af02b4
Reviewed-on: https://go-review.googlesource.com/8502
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-04-12 14:37:35 +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
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
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
Russ Cox
09d92b6bbf all: power64 is now ppc64
Fixes #8654.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/180600043
2014-12-05 19:13:20 -05:00
Austin Clements
f0bd539c59 [dev.power64] all: merge default into dev.power64
This brings dev.power64 up-to-date with the current tip of
default.  go_bootstrap is still panicking with a bad defer
when initializing the runtime (even on amd64).

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/152570049
2014-10-22 15:51:54 -04:00
Austin Clements
2bd616b1a7 build: merge the great pkg/ rename into dev.power64
This also removes pkg/runtime/traceback_lr.c, which was ported
to Go in an earlier commit and then moved to
runtime/traceback.go.

Reviewer: rsc@golang.org
          rsc: LGTM
2014-10-22 13:25:37 -04:00
Ian Lance Taylor
7abc8c4acc debug/elf: add comments explaining applyRelocations for amd64/arm64
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/155190043
2014-10-09 14:38:45 -07:00
Russ Cox
c007ce824d build: move package sources from src/pkg to src
Preparation was in CL 134570043.
This CL contains only the effect of 'hg mv src/pkg/* src'.
For more about the move, see golang.org/s/go14nopkg.
2014-09-08 00:08:51 -04:00