The first field of the func data stored by the linker is the
entry PC for the function. Prior to this change, this was stored
as a relocation to the function. Change this to be an offset
relative to runtime.text.
This reduces the number of relocations on darwin/arm64 by about 10%.
It also slightly shrinks binaries:
file before after Δ %
addr2line 3803058 3791298 -11760 -0.309%
api 5140114 5104242 -35872 -0.698%
asm 4886850 4840626 -46224 -0.946%
buildid 2512466 2503042 -9424 -0.375%
cgo 4374770 4342274 -32496 -0.743%
compile 22920530 22769202 -151328 -0.660%
cover 4624626 4588242 -36384 -0.787%
dist 3217570 3205522 -12048 -0.374%
doc 3715026 3684498 -30528 -0.822%
fix 3148226 3119266 -28960 -0.920%
link 6350226 6313362 -36864 -0.581%
nm 3768850 3757106 -11744 -0.312%
objdump 4140594 4127618 -12976 -0.313%
pack 2227474 2218818 -8656 -0.389%
pprof 13598706 13506786 -91920 -0.676%
test2json 2497234 2487426 -9808 -0.393%
trace 10198066 10118498 -79568 -0.780%
vet 6930658 6889074 -41584 -0.600%
total 108055044 107366900 -688144 -0.637%
It should also incrementally speed up binary launching.
This is the first step towards removing enough relocations
that pages that were previously dirtied by the loader may remain clean,
which will offer memory savings useful in constrained environments.
Change-Id: Icfba55e696ba2f9c99c4f179125ba5a3ba4369c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/351463
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Use a Go 1.15 executable for the benchmark, because it is handy.
Most of the code paths are shared for Go 1.2+.
Change-Id: Id7ddc76a05d76335108c58ff9f1ab2ff837b7227
Reviewed-on: https://go-review.googlesource.com/c/go/+/353131
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
These methods are for use with Go 1.2 _and later_ pcln tables.
Make that clearer.
Change-Id: Iee06e0828fd5895639b654363b6d91bf9151d224
Reviewed-on: https://go-review.googlesource.com/c/go/+/352950
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
debug/gosym assumes throughout that bogus input means a malformed file.
That's generally true, but not when you're changing the package.
In that case, the panic usually indicates a newly introduced bug,
and seeing the panic is really useful.
Add a manually-enabled way to make panics panic.
Change-Id: I07af6c7b982c4cf61180db29f07aa63576ba7837
Reviewed-on: https://go-review.googlesource.com/c/go/+/352949
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
A subsequent change will duplicate most of case ver116.
Make it easier to read.
Change-Id: I3a93181c7f094b12715b8a618e9efef7a1438a27
Reviewed-on: https://go-review.googlesource.com/c/go/+/351909
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
The original error is currently discarded, and that makes it difficult
to know what failed, in case we want to retry only certain errors.
Change-Id: Id7e927ec242464249c4dfa5cda0f264adef3c898
Reviewed-on: https://go-review.googlesource.com/c/go/+/317851
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
AttrBitOffset is deprecated (but reserved) in DWARFv4. This fix adds
logic to check the new AttrDataBitOffset attribute if AttrBitOffset
attribute is not present.
Fixes#46784
Change-Id: I7406dcaa4c98e95df72361fd4462c39e6be8879d
GitHub-Last-Rev: 5aa10d0491
GitHub-Pull-Request: golang/go#46790
Reviewed-on: https://go-review.googlesource.com/c/go/+/328709
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Some ET_EXEC binaries might have relocations for non-loadable sections
like .debug_info. These relocations must not be applied, because:
* They may be incorrect
* The correct relocations were already applied at link time
Binaries in Linux Kernel debug packages like Fedora/Centos kernel-debuginfo
are such examples. Relocations for .debug_* sections are included in the
final binaries because they are compiled with --emit-relocs, but the resulting
relocations are incorrect and shouldn't be used when reading DWARF sections.
Fixes#46673
Change-Id: I2b4214f1584bfc243446d0eaee41512657325b95
GitHub-Last-Rev: 8350fad059
GitHub-Pull-Request: golang/go#46698
Reviewed-on: https://go-review.googlesource.com/c/go/+/327009
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
A user encountered a debug/dwarf crash when running the dwarf2json
tool (https://github.com/volatilityfoundation/dwarf2json) on a
debug-built copy of the linux kernel. In this crash, the DWARF type
reader was trying to examine the contents of an array type while that
array type was still in the process of being constructed (due to
cycles in the type graph).
To avoid such situations, this patch extends the mechanism introduced
in https://go-review.googlesource.com/18459 (which handles typedef
types) to delay fixup of array types as well.
Change-Id: I303f6ce5db1ca4bd79da3581957dfc2bfc17cc01
Reviewed-on: https://go-review.googlesource.com/c/go/+/319329
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Yi Chou <yich@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
(It doesn't work and isn't used by default.)
Change-Id: I90118d889bd963471f0915d8183502b55bd9dbf2
Reviewed-on: https://go-review.googlesource.com/c/go/+/312045
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
DWARF sections generated by mingw-clang seem to include these
(not often - only one out of many in the binary that I am looking at).
Skipping over them, everything parses correctly.
This makes TestDefaultLinkerDWARF pass on windows/arm64.
Change-Id: Ie4a7daa1423f51cbc8c4aac88b1d27c3b52ee880
Reviewed-on: https://go-review.googlesource.com/c/go/+/312031
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Change-Id: I7df915978af3488f46a27595a1b04d0d33f81f7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/302369
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
MIPS32 uses .gnu.attributes and .MIPS.abiflags sections to mark FP ABI
the object is using, and the kernel will set the correct FP mode for it.
Currrently Go doesn't generate these 2 sections. If we link object
without these 2 sections togather FPXX objects, the result will be FPXX,
which is wrong:
FP32 + FPXX -> FP32
FPXX + FP64 -> FP64
FP32 + FP64 -> reject
These 2 sections is also needed to support FPXX and FP64 in future.
More details about FP32/FPXX/FP64 are explained in:
https://web.archive.org/web/20180828210612/https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_InterlinkingFixes#39677
Change-Id: Ia34e7461dee38a4f575dd8ace609988744512ac1
Reviewed-on: https://go-review.googlesource.com/c/go/+/239217
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Meng Zhuo <mzh@golangcn.org>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild
Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/294430
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
We still need to add test data, but as yet we haven't identified
a good Windows arm64 compiler to produce small binaries.
This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
Change-Id: Ifbecb9a6e25f7af38e20b7d7830df7f5efe2798a
Reviewed-on: https://go-review.googlesource.com/c/go/+/288820
Trust: Russ Cox <rsc@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
In an executable, the debug_addr and debug_rnglists sections are
assembled by concatenating the input sections, and each input section
has a header, and each header may have different attributes. So just
parsing the single header isn't right. Parsing the header is not
necessary to handle offsets into these sections which is all we do.
Looking at the header is also problematic because GCC with
-gsplit-dwarf when using DWARF versions 2 through 4 emits a
.debug_addr section, but it has no header. The header was only added
for DWARF 5. So we can't parse the header at all for that case, and we
can't even detect that case in general.
This CL also fixes SeekPC with addrx and strx formats, by not using
the wrong compilation unit to find the address or string base.
To make that work when parsing the compilation unit itself, we add
support for delay the resolution of those values until we know the base.
New test binaries built with
gcc -gdwarf-5 -no-pie debug/dwarf/testdata/line[12].c
(gcc (Debian 10.2.0-15) 10.2.0)
clang -gdwarf-5 -no-pie debug/dwarf/testdata/line[12].c
(clang version 9.0.1-14)
Change-Id: I66783e0eded629bf80c467767f781164d344a54d
Reviewed-on: https://go-review.googlesource.com/c/go/+/277233
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
As part of #42026, these helpers from io/ioutil were moved to os.
(ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.)
Update the Go tree to use the preferred names.
As usual, code compiled with the Go 1.4 bootstrap toolchain
and code vendored from other sources is excluded.
ReadDir changes are in a separate CL, because they are not a
simple search and replace.
For #42026.
Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/266365
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This patch changes the way the linker emits the DWARF line table
prologue, specifically the file table. Previously files were left
unmodified, and the directory table was empty. For each compilation
unit we now scan the unit file table and build up a common set of
directories, emit them into the directory table, and then emit file
entries that refer to the dirs. This provides a modest binary size
savings.
For kubernetes kubelet:
$ objdump -h /tmp/kubelet.old | fgrep debug_line
36 .zdebug_line 019a55f5 0000000000000000 0000000000000000 084a5123 2**0
$ objdump -h /tmp/kubelet.new | fgrep debug_line
36 .zdebug_line 01146fd2 0000000000000000 0000000000000000 084a510a 2**0
[where the value following the section name above is the section size
in hex, so roughly a 30% decrease in this case.]
The actual savings will depend on the length of the pathnames
involved, so it's hard to really pin down how much savings we'll see
here. In addition, emitting the files this way reduces the
"compressibility" of the line table, so there could even be cases
where we don't win at all.
Updates #6853, #19784, #36495.
Change-Id: I298d8561da5ed3ebc9d38aa772874851baa2f4f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/263017
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Trust: Than McIntosh <thanm@google.com>
Updates the (*Data).Ranges method to work with DWARFv5 which uses the
new debug_rnglists section instead of debug_ranges.
This does not include supporting DW_FORM_rnglistx.
General support for DWARFv5 was added by CL 175138.
Change-Id: I01f919a865616a3ff12f5bf649c2c9abf89fcf52
Reviewed-on: https://go-review.googlesource.com/c/go/+/236657
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Emmanuel Odeke <emm.odeke@gmail.com>
The old ioutil references are still valid, but update our code
to reflect best practices and get used to the new locations.
Code compiled with the bootstrap toolchain
(cmd/asm, cmd/dist, cmd/compile, debug/elf)
must remain Go 1.4-compatible and is excluded.
Also excluded vendored code.
For #41190.
Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/263142
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2 conflicts, that make sense.
src/cmd/internal/obj/objfile.go
src/cmd/link/internal/loader/loader.go
Change-Id: Ib224e2d248cb568fa1e888af79dd908b2f5e05ff
Introduce GOOS=ios for iOS systems. GOOS=ios matches "darwin"
build tag, like GOOS=android matches "linux" and GOOS=illumos
matches "solaris". Only ios/arm64 is supported (ios/amd64 is
not).
GOOS=ios and GOOS=darwin remain essentially the same at this
point. They will diverge at later time, to differentiate macOS
and iOS.
Uses of GOOS=="darwin" are changed to (GOOS=="darwin" || GOOS=="ios"),
except if it clearly means macOS (e.g. GOOS=="darwin" && GOARCH=="amd64"),
it remains GOOS=="darwin".
Updates #38485.
Change-Id: I4faacdc1008f42434599efb3c3ad90763a83b67c
Reviewed-on: https://go-review.googlesource.com/c/go/+/254740
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
For a common pattern of iterating only over top-level compilation units (CU)
Reader.SkipChildren has decode and meterialize all CU subentries just
to skip them, because DW_TAG_compile_unit does not have DW_AT_sibling.
However, CUs have total size encoded before the unit and we already parse them
and know all unit sizes.
Optimize Reader.SkipChildren to use that size when skipping CUs children.
This speeds up iteration over a 1.3GB object file from 7.5s to 0.73s.
Change-Id: I2a8f00955159b4bd13571409f4817805f934cb69
Reviewed-on: https://go-review.googlesource.com/c/go/+/256217
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
commit 72ec930fa7 added basic support for
relocations, but assumed that the symbol value would be 0, likely because
.debug_info always has address == 0 in the ELF section headers.
CL 195679 added further support for relocations, but explicitly encoded
the original assumption that section addresses would be 0.
This change removes that assumption: all relocations will now be
properly computed based on the target symbol value even when that symbol
is a section with a non-zero address.
Typically, sections that are part of a LOAD program segment have
non-zero addresses. For example, .debug_ranges relocations could be
relative to .text, which usually has an address > 0.
Fixes#40879
Change-Id: Ib0a616bb8b05d6c96d179b03ca33a10946fc5d59
GitHub-Last-Rev: 4200de7326
GitHub-Pull-Request: golang/go#41038
Reviewed-on: https://go-review.googlesource.com/c/go/+/250559
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Also don't restart DWARF reading from beginning when we are testing
multiple entries.
Also reformat relocationTests slice to use indexed literals.
Change-Id: Ia5f17214483394d0ef033be516df61f0bdc521b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/251637
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Move the pctables out of pclntab_old. Creates a new generator symbol,
runtime.pctab, which holds all the deduplicated pctables. Also, tightens
up some of the types in runtime.
Darwin, cmd/compile statistics:
alloc/op
Pclntab_GC 26.4MB ± 0% 13.8MB ± 0%
allocs/op
Pclntab_GC 89.9k ± 0% 86.4k ± 0%
liveB
Pclntab_GC 25.5M ± 0% 24.2M ± 0%
No significant change in binary size.
Change-Id: I1560fd4421f8a210f8d4b508fbc54e1780e338f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/248332
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
CL 246497 introduced bugs in gosym that the long tests caught. These two
bugs were:
1) In 1.16, 0 is now a valid file number from pcfile tables.
2) Also, in 1.16, when we scan all functions looking for a pc/file pair,
the values returned from pcfile are no longer the direct offset into
the file table. Rather, the values from pcfile are the offset into
the cu->file look-up table.
This CL fixes those two issues.
Change-Id: I0cd280bdcaeda89faaf9fac41809abdb87734499
Reviewed-on: https://go-review.googlesource.com/c/go/+/248317
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Creates two new symbols: runtime.cutab, and runtime.filetab, and strips
the filenames out of runtime.pclntab_old.
All stats are for cmd/compile.
Time:
Pclntab_GC 48.2ms ± 3% 45.5ms ± 9% -5.47% (p=0.004 n=9+9)
Alloc/op:
Pclntab_GC 30.0MB ± 0% 29.5MB ± 0% -1.88% (p=0.000 n=10+10)
Allocs/op:
Pclntab_GC 90.4k ± 0% 73.1k ± 0% -19.11% (p=0.000 n=10+10)
live-B:
Pclntab_GC 29.1M ± 0% 29.2M ± 0% +0.10% (p=0.000 n=10+10)
binary sizes:
NEW: 18565600
OLD: 18532768
The size differences in the binary are caused by the increased size of
the Func objects, and (less likely) some extra alignment padding needed
as a result. This is probably the maximum increase in size we'll size
from the pclntab reworking.
Change-Id: Idd95a9b159fea46f7701cfe6506813b88257fbea
Reviewed-on: https://go-review.googlesource.com/c/go/+/246497
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Move the function names out of runtime.pclntab_old, creating
runtime.funcnametab. There is an unfortunate artifact in this change in
that calculating the funcID still requires loading the name. Future work
will likely pull this out and put it into the object file Funcs.
ls -l cmd/compile (darwin):
before: 18524016
after: 18519952
The difference in size can be attributed to alignment in pclntab_old.
Change-Id: Ibcbb230d4632178f8fcd0667165f5335786381f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/243223
Reviewed-by: Austin Clements <austin@google.com>
As of July 2020, a fair amount of the new linker's live memory, and
runtime is spent generating pclntab. In an effort to streamline that
code, this change starts breaking up the generation of runtime.pclntab
into smaller chunks that can run later in a link. These changes are
described in an (as yet not widely distributed) document that lays out
an improved format. Largely the work consists of breaking up
runtime.pclntab into smaller pieces, stopping much of the data
rewriting, and getting runtime.pclntab into a form where we can reason
about its size and look to shrink it. This change is the first part of
that work -- just pulling out the header, and demonstrating where a
majority of that work will be.
Change-Id: I65618d0d0c780f7e5977c9df4abdbd1696fedfcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/241598
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
The fields aren't too useful for Go 1.2 and later, but they aren't
actually nil.
Fixes#38754
Change-Id: Ia13a224f623697a00dea8ba0225633e1b9308c9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/230940
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
A DWARF testpoint was calling t.Fatal() but should have been calling
t.Fatalf(); switch it to the correct method.
Change-Id: I996a1041adea4299cda85c147a35b513a219b970
Reviewed-on: https://go-review.googlesource.com/c/go/+/228790
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This CL copies IMAGE_FILE_*, IMAGE_SUBSYSTEM_* and
IMAGE_DLLCHARACTERISTICS_* consts from cmd/link/internal/ld package.
The consts are also used in cmd/go and debug/pe tests. So avoid the
duplication.
The consts are defined in
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
and might be useful to other Go users.
The CL also adds some related consts.
RELNOTE=yes
Change-Id: Iaa868deaffc7c61051f2273397f3e7e101880a5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/222637
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Starting with macOS 10.15 (Catalina), Apple now requires all software
distributed outside of the App Store to be notarized. Any binaries we
distribute must abide by a strict set of requirements like code-signing
and having a minimum target SDK of 10.9 (amongst others).
Apple’s notarization service will recursively inspect archives looking to
find notarization candidate binaries. If it finds a binary that does not
meet the requirements or is unable to decompress an archive, it will
reject the entire distribution. From cursory testing, it seems that the
service uses content sniffing to determine file types, so changing
the file extension will not work.
There are some binaries and archives included in our distribution that
are being detected by Apple’s service as potential candidates for
notarization or decompression. As these are files used by tests and some
are intentionally invalid, we don’t intend to ever make them compliant.
As a workaround for this, we base64-encode any binaries or archives that
Apple’s notarization service issues a warning for, as these warnings will
become errors in January 2020.
Updates #34986
Change-Id: I106fbb6227b61eb221755568f047ee11103c1680
Reviewed-on: https://go-review.googlesource.com/c/go/+/208118
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
You were a useful port and you've served your purpose.
Thanks for all the play.
A subsequent CL will remove amd64p32 (including assembly files and
toolchain bits) and remaining bits. The amd64p32 removal will be
separated into its own CL in case we want to support the Linux x32 ABI
in the future and want our old amd64p32 support as a starting point.
Updates #30439
Change-Id: Ia3a0c7d49804adc87bf52a4dea7e3d3007f2b1cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/199499
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Currently, the line table reader keeps the file name table internal.
However, there are various attributes like AttrDeclFile and
AttrCallFile whose value is an index into this table. Hence, in order
to interpret these attributes, we need access to the file name table.
This CL adds a method to LineReader that exposes the file table of the
current compilation unit in order to allow consumers to interpret
attributes that index into this table.
Change-Id: I6b64b815f23b3b0695036ddabe1a67c3954867dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/192699
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Currently, dwarf.Reader exposes the current compilation unit's address
size, but doesn't expose its byte order. Both are important for
decoding many attributes. For example, location descriptions include
addresses that are encoded in native form for the CU.
This CL exposes the byte order of the compilation unit in the same way
we already expose its address size, which makes it possible to decode
attributes containing native addresses.
Change-Id: I92f156818fe92b049d1dfc1613816bb1689cfadf
Reviewed-on: https://go-review.googlesource.com/c/go/+/192698
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
RELNOTE=This change adds an underscore to all Go symbols in darwin, and
the behavior might be confusing to users of tools like "nm", etc.
Fixes#33808
Change-Id: I1849e6618c81215cb9bfa62b678f6f389cd009d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/196217
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
RELNOTE=This change adds an underscore to all Go symbols in darwin, and
the behavior might be confusing to users of tools like "nm", etc.
Fixes#33808
Change-Id: I19ad626026ccae1e87b3bb97b6bb9fd55e95e121
Reviewed-on: https://go-review.googlesource.com/c/go/+/195619
Run-TryBot: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
The elf reader's method for reading in DWARF section data has support
for applying selected relocations when the debug/dwarf readers are
being used on relocatable objects. This patch extends the set of
relocations applied slightly. In particlar, prior to this for some
architectures we were only applying relocations whose target symbol
was a section symbol; now we also include some relocations that target
other symbols. This is needed to get meaningful values for compilation
unit DIE low_pc attributes, which typically target a specific function
symbol in text.
Fixes#31363.
Change-Id: I34b02e7904cd7f2dea74197f73fa648141d15212
Reviewed-on: https://go-review.googlesource.com/c/go/+/195679
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Use the following (suboptimal) script to obtain a list of possible
typos:
#!/usr/bin/env sh
set -x
git ls-files |\
grep -e '\.\(c\|cc\|go\)$' |\
xargs -n 1\
awk\
'/\/\// { gsub(/.*\/\//, ""); print; } /\/\*/, /\*\// { gsub(/.*\/\*/, ""); gsub(/\*\/.*/, ""); }' |\
hunspell -d en_US -l |\
grep '^[[:upper:]]\{0,1\}[[:lower:]]\{1,\}$' |\
grep -v -e '^.\{1,4\}$' -e '^.\{16,\}$' |\
sort -f |\
uniq -c |\
awk '$1 == 1 { print $2; }'
Then, go through the results manually and fix the most obvious typos in
the non-vendored code.
Change-Id: I3cb5830a176850e1a0584b8a40b47bde7b260eae
Reviewed-on: https://go-review.googlesource.com/c/go/+/193848
Reviewed-by: Robert Griesemer <gri@golang.org>
Fix a buglet in abbrev processing related to DW_FORM_indirect. When
reading an abbrev entry if we encounter an attribute with form
DW_FORM_indirect, leave the class as ClassUnknown, then when the
abbrev is walked during the reading of the DIE fill in the class based
on the value read at that point (code for handling DW_FORM_indirect
seems to be already partially in place in the DIE reader).
Updates #33488.
Change-Id: I9dc89abf5cc8d7ea96824c0011bef979de0540bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/190158
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Also add a few other missing constants.
Also rerun current version of stringer.
Change-Id: I004ef27f6b40fe2cab64c52d169255dfea43fa01
Reviewed-on: https://go-review.googlesource.com/c/go/+/175137
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
The debug/pe package assumes there are always 16 entries in
DataDirectory in OptionalHeader32/64
ref pe.go:
...
NumberOfRvaAndSizes uint32
DataDirectory [16]DataDirectory
}
...
But that is not always the case, there could be less no of
entries (PE signed linux kernel for example):
$ sudo pev /boot/vmlinuz-4.15.0-47-generic
....
Data-dictionary entries: 6
....
In such case, the parsing gives incorrect results.
This changes aims to fix that by:
1. Determining type of optional header by looking at header
magic instead of size
2. Parsing optional header in 2 steps:
a. Fixed part
b. Variable data directories part
Testing:
1. Fixed existing test cases to reflect the change
2. Added new file (modified linux kernel image)
which has smaller number of data directories
Fixes#32126
Change-Id: Iee56ecc4369a0e75a4be805e7cb8555c7d81ae2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/177959
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Currently, File.ImportedSymbols is the only API that exposes the GNU
symbol version information for dynamic symbols. Unfortunately, it also
filters to specific types of symbols, and only returns symbol names.
The cgo tool is going to need symbol version information for more
symbols. In order to support this and make the API more orthogonal,
this CL adds version information to the Symbol type and updates
File.DynamicSymbols to fill this in. This has the downside of
increasing the size of Symbol, but seems to be the most natural API
for exposing this. I also explored 1) adding a method to get the
version information for the i'th dynamic symbol, but we don't use
symbol indexes anywhere else in the API, and it's not clear if this
index would be 0-based or 1-based, and 2) adding a
DynamicSymbolVersions method that returns a slice of version
information that parallels the DynamicSymbols slice, but that's less
efficient to implement and harder to use.
For #31912.
Change-Id: I69052ac3894f7af2aa9561f7085275130e0cf717
Reviewed-on: https://go-review.googlesource.com/c/go/+/184099
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Fix a stale reference to Apple's Mach-O file format reference in the
header comment.
Change-Id: I5f120fd5bf31ee0b8b29a33879305abb31a7913d
Reviewed-on: https://go-review.googlesource.com/c/go/+/182957
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Shorten some of the longest tests that run during all.bash.
Removes 7r 50u 21s from all.bash.
After this change, all.bash is under 5 minutes again on my laptop.
For #26473.
Change-Id: Ie0460aa935808d65460408feaed210fbaa1d5d79
Reviewed-on: https://go-review.googlesource.com/c/go/+/177559
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Most changes are removing redundant declaration of type when direct
instantiating value of map or slice, e.g. []T{T{}} become []T{{}}.
Small changes are removing the high order of subslice if its value
is the length of slice itself, e.g. T[:len(T)] become T[:].
The following file is excluded due to incompatibility with go1.4,
- src/cmd/compile/internal/gc/ssa.go
Change-Id: Id3abb09401795ce1e6da591a89749cba8502fb26
Reviewed-on: https://go-review.googlesource.com/c/go/+/166437
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Like GOOS=android which implies the "linux" build tag, GOOS=illumos
implies the "solaris" build tag. This lets the existing ecosystem of
packages still work on illumos, but still permits packages to start
differentiating between solaris and illumos.
Fixes#20603
Change-Id: I8f4eabf1a66060538dca15d7658c1fbc6c826622
Reviewed-on: https://go-review.googlesource.com/c/go/+/174457
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Enhance the type decoder to do a better job handling unknown type
tags. DWARF has a number of type DIEs that this package doesn't handle
(things like "pointer to member" types in C++); avoid crashing for
such types, but instead return a placeholder "UnsupportedType" object
(this idea suggested by Austin). This provides a compromise between
implementing the entire kitchen sink and simply returning an error
outright on any unknown type DIE.
Fixes#29601.
Change-Id: I2eeffa094c86ef3a2c358ee42e8e629d74cec2ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/158797
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Symbol name with linker prefix like "type." and "go." is not parsed
correctly and returns the prefix as parts of package name.
So just returns empty string for symbol name start with linker prefix.
Fixes#29551
Change-Id: Idb4ce872345e5781a5a5da2b2146faeeebd9e63b
Reviewed-on: https://go-review.googlesource.com/c/go/+/156397
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
It turns out not to be necessary. Russ expressed a preference for
avoiding module fetches over making 'go mod tidy' work within std and
cmd right away, so for now we will make the loader use the vendor
directory for the standard library even if '-mod=vendor' is not set
explicitly.
Updates #30228
Change-Id: Idf7208e63da8cb7bfe281b93ec21b61d40334947
Reviewed-on: https://go-review.googlesource.com/c/go/+/166357
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Currently they aren't marked as deprecated as Godoc, but the comments
mention that they are deprecated. Mark them as officially deprecated.
Fixes#29576
Change-Id: I795c698ac715476023d80579d60932fba4c5edde
Reviewed-on: https://go-review.googlesource.com/c/go/+/156331
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
If an ELF file has no section header table (shoff = 0), shnum must be
zero as well according to elf(5).
So far, when only shnum was zero but shoff was non-zero (i.e. in an
invalid ELF file) shstrndx wasn't properly checked and could result in
an 'index out of range' later on.
Fixes#10996
Change-Id: Ic248d2d77099b0036458e2a844b086a5f463c844
Reviewed-on: https://go-review.googlesource.com/c/162857
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
If a PE file with invalid optional header size (neither
sizeofOptionalHeader32 nor sizeofOptionalHeader64) is passed to NewFile,
the File.OptionalHeader will be nil which leads to a panic in
(*File).ImportedSymbols().
Fixes#30250
Change-Id: Ie97306de4a0e2dcfdc7b1b599891f574aa63adca
Reviewed-on: https://go-review.googlesource.com/c/162858
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Apparently (see
https://github.com/golang/go/issues/27904#issuecomment-442140627
for details) kernel32.dll file is not present on windows/arm, so
use ws2_32.dll instead. ws2_32.dll imports table also lives in
'.rdata' section, so ws2_32.dll is as good as kernel32.dll for
testing issue #16103.
Updates #27904
Change-Id: Ibc72b24eea9a4d85abd371ffdcf00442e711b745
Reviewed-on: https://go-review.googlesource.com/c/151480
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TestImportTableInUnknownSection uses kernel32.dll file, but the error
message mentions atmfd.dll. Adjust error message to match the test.
This change should have been part of CL 151137.
Updates #27904
Change-Id: Ifc31a12134b328472191122f8426ab6ed234fbd4
Reviewed-on: https://go-review.googlesource.com/c/151477
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TestImportTableInUnknownSection was introduced in CL 110555 to
test PE executable with import table located in section other than
".idata". We used atmfd.dll for that purpose, but it seems
atmfd.dll is not present on some systems.
Use kernel32.dll instead. kernel32.dll import table is located in
".rdata" section, so it should do the job. And every Windows
system has kernel32.dll file.
Also make TestImportTableInUnknownSection run on windows-arm,
since windows-arm should also have kernel32.dll file.
Updates #27904
Change-Id: Ie005ee10e46ae0c06e83929d581e89f86c051eea
Reviewed-on: https://go-review.googlesource.com/c/151137
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Currently, TestPCLine manually invokes asm and link on its test data.
Once we introduce symbol ABIs this is going to become problematic
because the test program defines main.main and main.init in assembly
so they use ABI0, but the runtime expects to find them with the
internal ABI.
There are various ways we could solve this. This CL moves main.main
and main.init into Go code and switches to using "go build" to compile
and link the test binary. This has the added advantage of simplifying
this test.
For #27539.
Change-Id: I4c0cf6467f7a39e6b1500eca6ad2620b5ef2b73c
Reviewed-on: https://go-review.googlesource.com/c/146857
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit skips tests which aren't yet supported on AIX.
nosplit.go is disabled because stackGuardMultiplier is increased for
syscalls.
Change-Id: Ib5ff9a4539c7646bcb6caee159f105ff8a160ad7
Reviewed-on: https://go-review.googlesource.com/c/146939
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Since we're going to start compressing DWARF on Windows and maybe
Darwin, copy the ELF support for .zdebug sections to macho and pe. The
code is almost completely the same across the three.
While I was here I added support for compressed .debug_type sections,
which I presume were overlooked before.
Tests will come in a later CL once we can actually generate compressed
PE/Mach-O binaries, since there's no other good way to get test data.
Updates #25927, #11799
Change-Id: Ie920b6a16e9270bc3df214ce601a263837810376
Reviewed-on: https://go-review.googlesource.com/119815
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
CL 110555 introduced some changes which were not properly gofmt'ed.
Because the CL was sent via Github the gofmt checks usually performed by
git-codereview didn't catch this (see #24946).
Change-Id: I65c1271620690dbeec88b4ce482d158f7d6df45d
Reviewed-on: https://go-review.googlesource.com/114255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This parses the import table properly which allows for debug/pe
to extract import symbols from pecoffs linked with an import
table in a section named something other than ".idata"
The section names in a pecoff object aren't guaranteed to actually
mean anything, so hardcoding a search for the ".idata" section
is not guaranteed to find the import table in all shared libraries.
This resulted in debug/pe being unable to read import symbols
from some libraries.
The proper way to locate the import table is to validate the
number of data directory entries, locate the import entry, and
then use the va to identify the section containing the import
table. This patch does exactly this.
Fixes#16103.
Change-Id: I3ab6de7f896a0c56bb86c3863e504e8dd4c8faf3
GitHub-Last-Rev: ce8077cb15
GitHub-Pull-Request: golang/go#25193
Reviewed-on: https://go-review.googlesource.com/110555
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Provide a complete list of EM_* and ELFOSABI_* constants.
Compiled from the tables at
http://www.sco.com/developers/gabi/latest/ch4.eheader.html
and llvm/BinaryFormat/ELF.h from LLVM.
Change-Id: Ice1e1476076fafdb8bb8af848caec6d80a82c452
Reviewed-on: https://go-review.googlesource.com/112115
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The general policy for the current state of js/wasm is that it only
has to support tests that are also supported by nacl.
The test nilptr3.go makes assumptions about which nil checks can be
removed. Since WebAssembly does not signal on reading a null pointer,
all nil checks have to be explicit.
Updates #18892
Change-Id: I06a687860b8d22ae26b1c391499c0f5183e4c485
Reviewed-on: https://go-review.googlesource.com/110096
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Based on the code from https://github.com/riscv/riscv-go/ originally
written by Amol Bhave.
Change-Id: I8d5377096d4ff8b198dadb630511f9a0347f9797
Reviewed-on: https://go-review.googlesource.com/107339
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
cmd/link produces ELF executables on all these geese, so enable
TestNoSectionOverlaps for them as well. Also add a skip message.
Change-Id: I374651dde3679271ef8c0c375c9cabd1adbca310
Reviewed-on: https://go-review.googlesource.com/107535
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This cuts the allocated space while executing
go tool objdump -S `go tool -n compile`
by over 10%.
It also speeds it up slightly:
name old time/op new time/op delta
ObjdumpSCompiler 9.03s ± 1% 8.88s ± 1% -1.59% (p=0.000 n=20+20)
Updates #24725
Change-Id: Ic6ef8e273ede589334ab6e07099ac2e5bdf990c9
Reviewed-on: https://go-review.googlesource.com/106798
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
EM_AARCH64 is defined as a constant, but the corresponding entry in
machineStrings is missing. Add it.
Change-Id: I6506404386efe608877095e635a290bbc0686215
Reviewed-on: https://go-review.googlesource.com/106035
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
By grepping for ]string{$, one can find many manual implementations of
stringer. The debug/dwarf ones needed the new -trimprefix flag, too.
html/template was fairly simple, just implementing the fallback as
stringer would. The changes there are trivial.
The ones in debug/dwarf needed a bit of extra logic since the GoString
wants to use its own format, depending on whether or not the value is
one of the known constants.
Change-Id: I501ea7deaa538fa425c8e9c2bb895f480169273f
Reviewed-on: https://go-review.googlesource.com/77253
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
No test as the only system I know that uses 64-bit DWARF is AIX.
Change-Id: I24e225253075be188845656b6778993c2d24ebf5
Reviewed-on: https://go-review.googlesource.com/84379
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
StructField.ByteSize is almost always unset; document that Type.Size()
is the place to look.
The dwarf package doesn't spend much effort teaching you DWARF, so I
don't know what level of handholding is appropriate. Still, no harm in a
little comment.
Closes#21093
Change-Id: I0ed8cad2fa18e10a47d264ff16c176d603d6033c
Reviewed-on: https://go-review.googlesource.com/71671
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>