aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/objfile
AgeCommit message (Collapse)Author
2024-01-25all: prealloc slice with possible minimum capabilitiesShulhan
2023-08-15cmd/internal/archive: skip sentinel archive entries created by Go cmdThan McIntosh
When reading an archive, check for the presence of sentinel entries created by the Go command. These zero-sized marker entries don't contain any useful symbols, but rather are there to communicate info to the linker; ignore them during symbol dumping. Fixes #62036. Change-Id: Ied017b0c5b92a3cf6fd13bb9c9f3a9664e4f20f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/519635 Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-03runtime,runtime/pprof: get memory mappings on darwin.Cosmos Nicolaou
Displaying assembly language has never worked for Apple Silicon macs (see #50891). This change uses mach_vm_region to obtain the necessary VM mappings to allow for locating assembly instructions for a cpu profile. Fixes #50891 Change-Id: Ib968c55a19b481b82f63337276b552f3b18f69d1 Reviewed-on: https://go-review.googlesource.com/c/go/+/503919 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-04-07cmd/internal/objfile: align the load address of ELF binaryCherry Mui
The ELF ABI just requires that the address and the offset of a segment are congruent modulo the alignment, but does not require the start address to be aligned. While usually the segment's start address is aligned, apparently the zig linker generates binary with unaligned address. At the run time, the memory mapping that contains the segment starts at an aligned address (rounding down). Use the aligned address for the load address, which matches the mapping. Apparently this is what the pprof library expects. Fixes #59466. Change-Id: Ife78909b20b7bc975ac4c76f2c5f5db325ddec9b Reviewed-on: https://go-review.googlesource.com/c/go/+/483035 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-09-22cmd/internal/objfile: read file/line information for ELF PIE binariesCherry Mui
For PIE binaries, the .gopclntab section doesn't have the usual name, but .data.rel.ro.gopclntab. Try the relro version as well. If both failed (e.g. for externally linked PIE binaries), try runtime.pclntab symbol. This should make cmd/objdump able to print the file/line information for PIE binaries. I attempted to do this a few years ago, but that wasn't enough, because the pclntab itself contains dynamic relocations which are not applied by the tool. As of Go 1.18 the pclntab is mostly position independent and does not contain dynamic relocations, so this should be possible now. Fixes #17883. Updates #46639. Change-Id: I85dc3d50ffcc1a4b187a349479a6a162de1ab2b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/227483 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-20all: replace package ioutil with os and io in srcAndy Pan
For #45557 Change-Id: I56824135d86452603dd4ed4bab0e24c201bb0683 Reviewed-on: https://go-review.googlesource.com/c/go/+/426257 Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Andy Pan <panjf2000@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-20cmd/pprof: fix addr calculation for WindowsEgon Elbre
This makes it possible to use `disasm` with ASLR windows binaries. For #46639 Change-Id: I08aff38dc0b33fdfb07e0206766db066e33207d1 Reviewed-on: https://go-review.googlesource.com/c/go/+/416976 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-11-24cmd/internal/objfile, debug/gosym: use the address of runtime.text as textStartCherry Mui
Tools like objdump uses the pcln table to find the line number of a given PC. For a PIE binary, at least in some cases such as on macOS 12 with ld64-711, the table contains unrelocated address, which does not match the address in the symbol table, causing the lookup to fail. In Go 1.18 the pcln table is essentually position independent, except the start PC. Instead of reading the static content from the table, use the PC of runtime.text from the symbol table. While here, change the type of textStart to uint64. What matters here is the word size of the target program, not the host, so it shouldn't be uintptr. Fixes #49700. Change-Id: I517d79be7ba02dd4dd0275e75a11a136b08d76cd Reviewed-on: https://go-review.googlesource.com/c/go/+/366695 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-09-28cmd/internal/objfile: use aux symbol for pcdata referencesCherry Mui
Pcdata are now separate aux symbols. Read them from aux, instead of using funcinfo. Change-Id: Ib3e4b5cff1e3329d0600504a8829a969a9c9f517 Reviewed-on: https://go-review.googlesource.com/c/go/+/352612 Trust: Cherry Mui <cherryyz@google.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2021-05-10cmd/internal/objfile: add objabi.SNOPTRDATA to "D"Tao Qingyun
Change-Id: I65913534a4a3e2cbc0d4b00454dd3092eb908cb5 GitHub-Last-Rev: 39dc0d21b81eb6aeec4c29d4ea72e6c1ef7fea0d GitHub-Pull-Request: golang/go#43151 Reviewed-on: https://go-review.googlesource.com/c/go/+/277452 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Trust: Heschi Kreinick <heschi@google.com>
2021-04-30cmd/internal/objfile: emit better error for Go object of a different versionCherry Zhang
The Go object file format can change from version to version. Tools like cmd/objdump and cmd/nm only onderstand the current version of the object file. Currently, when it encounters an object built with a different version of the toolchain, it emits a generic error "unrecognized object file", which is not very helpful for users. This CL makes it emit a clearer error. Now it emits objdump: open go116.o: go object of a different version: go116ld Change-Id: I063c6078ed1da78f97cea65796779ae093a1a8cb Reviewed-on: https://go-review.googlesource.com/c/go/+/315609 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2021-02-19cmd/internal/objfile: recognize Windows ARM64 executablesRuss Cox
This CL is part of a stack adding windows/arm64 support (#36439), intended to land in the Go 1.17 cycle. Change-Id: I5ec459063d394b9f434d1b8b5030960b45061038 Reviewed-on: https://go-review.googlesource.com/c/go/+/288821 Trust: Russ Cox <rsc@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-01-11cmd/internal/objfile: don't require runtime.symtab symbol for XCOFFCherry Zhang
For some reason (that I didn't look into), externally linked AIX binaries don't have runtime.symtab symbol. Since recent Go releases (Go 1.3 maybe?), that symbol is empty and not necessary anyway. Don't require it. Fixes #40972. Change-Id: I73a1f0142195ea6debdba8a4f6e12cadc3980dc5 Reviewed-on: https://go-review.googlesource.com/c/go/+/279995 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2020-10-16cmd/internal/objfile: correct file table reading for Go object fileCherry Zhang
Apparently I never actually understood the new file table in Go object files. The PC value stream actually encodes the file index in the per-CU table. I thought it was indexing into a per-function table, which then contains index to the per-CU table. Remove the extra indirection. Change-Id: I0aea5629f7b3888ebe3a04fea437aa15ce89519e Reviewed-on: https://go-review.googlesource.com/c/go/+/262779 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-09-11[dev.link] all: merge branch 'master' into dev.linkCherry Zhang
Clean merge. Change-Id: Ib773b0bc00fd99d494f9331c3613bcc8285e48e3
2020-09-11cmd/internal/objfile: recognize Mach-O __DATA_CONST segment as read-only dataCherry Zhang
Updates #38830. Change-Id: I826c6b0a42bc8e48fcda556250ca4a95c73987eb Reviewed-on: https://go-review.googlesource.com/c/go/+/253918 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-08-22cmd/internal/objfile: use pe.FileHeader.Machine to reliably determine GOARCHAlex Brainman
Current peFile.goarch looks for symbols like "_rt0_386_windows" to determine GOARCH. But "_rt0_386_windows" is not present in executables built with cgo. Use pe.FileHeader.Machine instead. This should work with any Windows executable, not just with Go built executable. Fixes #39682 Change-Id: Ie0ffce664f4b8b8fed69b2ecc482425b042a38d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/240957 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-08-21[dev.link] all: merge branch 'master' into dev.linkCherry Zhang
Change-Id: Ic66b5138f3ecd9e9a48d7ab05782297c06e4a5b5
2020-08-19cmd/internal/objfile: cache computation of goobj.ArchTao Qingyun
Change-Id: I23774cf185e5fa6b89398001cd0655fb0c5bdb46 GitHub-Last-Rev: ca8cae2469b5fad84bd636a3305a484dfdcb0db2 GitHub-Pull-Request: golang/go#40877 Reviewed-on: https://go-review.googlesource.com/c/go/+/249180 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2020-08-13[dev.link] cmd/link, cmd/compile: create content addressable pcdata symsJeremy Faller
Switch pcdata over to content addressable symbols. This is the last step before removing these from pclntab_old. No meaningful benchmarks changes come from this work. Change-Id: I3f74f3d6026a278babe437c8010e22992c92bd89 Reviewed-on: https://go-review.googlesource.com/c/go/+/247399 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2020-08-11[dev.link] cmd/pack: use cmd/internal/archive packageCherry Zhang
Rewrite part of cmd/pack to use the cmd/internal/archive package. Change-Id: Ia7688810d3ea4d0277056870091f59cf09cffcad Reviewed-on: https://go-review.googlesource.com/c/go/+/247917 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-08-11[dev.link] cmd: remove "2", another roundCherry Zhang
Rename the goobj2 package to goobj. Change-Id: Iff97b5575cbac45ac44de96b6bd9d555b9a4a12a Reviewed-on: https://go-review.googlesource.com/c/go/+/246444 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2020-08-11[dev.link] cmd/internal/objfile: read Go object file using goobj2 packageCherry Zhang
Read Go object files using cmd/internal/goobj2 package directly, instead of using cmd/internal/goobj as an intermediate layer. Now cmd/internal/archive is only about reading archives. Change-Id: Ifecb217fb26c16c26fc1bbc3fba0ed44710020ed Reviewed-on: https://go-review.googlesource.com/c/go/+/246443 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2020-08-10[dev.link] cmd/internal/archive: rename from goobjCherry Zhang
Rename cmd/internal/goobj package to cmd/internal/archive. This is in preparation of a refactoring of object and archive file reading packages. With this CL, the cmd/internal/archive contains logic about reading Go object files. This will be moved to other places in later CLs. Change-Id: Ided7287492a4766183d6e49be840a7f361504d1d Reviewed-on: https://go-review.googlesource.com/c/go/+/246442 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Jeremy Faller <jeremy@golang.org>
2020-08-10[dev.link] use per package filenames to build pclntabJeremy Faller
In order to prevent renumbering of filenames in pclntab generation, use the per-package file list (previously only used for DWARF generation) as file-indices. This is the largest step to eliminate renumbering of filenames in pclntab. Note, this is probably not the final state of the file table within the object file. In this form, the linker loads all filenames for all objects. I'll move to storing the filenames as regular string symbols,and defaulting all string symbols to using the larger hash value to make generation of pcln simplest, and most memory friendly. Change-Id: I23daafa3f4b4535076e23100200ae0e7163aafe0 Reviewed-on: https://go-review.googlesource.com/c/go/+/245485 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2020-03-30cmd/objdump: add support for -gnu option on Go objdumpLynn Boger
This adds support for the -gnu option on Go objdump. When this option is used, then output will include gnu assembly in comments alongside the Go assembly. The objdump test was updated to test this new option. This option is supported for the arches found in golang.org/x that provide the GNUsyntax function. Updates #34372 Change-Id: I9e60e1691526607dda3c857c4564dcef408b8391 Reviewed-on: https://go-review.googlesource.com/c/go/+/225459 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-03-12cmd/objdump: guard against out-of-range lines from directives.David Chase
//line bogo.go:9999999 will cause 'go tool objdump' to crash unless bogo.go has that many lines. Guard the array index and return innocuous values (nil, nil) from the file cache. Fixes #36683 Change-Id: I4a9f8444dc611654d270cc876e8848dfd2f84770 Reviewed-on: https://go-review.googlesource.com/c/go/+/223081 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
2019-10-10all: remove nacl (part 3, more amd64p32)Brad Fitzpatrick
Part 1: CL 199499 (GOOS nacl) Part 2: CL 200077 (amd64p32 files, toolchain) Part 3: stuff that arguably should've been part of Part 2, but I forgot one of my grep patterns when splitting the original CL up into two parts. This one might also have interesting stuff to resurrect for any future x32 ABI support. Updates #30439 Change-Id: I2b4143374a253a003666f3c69e776b7e456bdb9c Reviewed-on: https://go-review.googlesource.com/c/go/+/200318 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-09-09src: gofmt -sAinar Garipov
Change-Id: I56d7eeaf777ac30886ee77428ca1ac72b77fbf7d Reviewed-on: https://go-review.googlesource.com/c/go/+/193849 Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-12-10all: move cmd/internal/xcoff to internal/xcoffClément Chigot
This commit moves cmd/internal/xcoff package to internal/xcoff because it will be needed to add XCOFF support in go/internal/gccgoimporter. Change-Id: Id12df0c438fb7db4a6a458fc1478480851bf7771 Reviewed-on: https://go-review.googlesource.com/c/152719 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-12-06cmd/internal/objfile: provide consistent output in objdump on ppc64xLynn Boger
This makes a change to disasm.go so it provides consistent output with the recent updates to arch/ppc64. Change-Id: I812e5da2423fd1a84406032fd91ddf9cc86b7c69 Reviewed-on: https://go-review.googlesource.com/c/152761 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-11-26cmd/link: fix XCOFF sectionsClément Chigot
XCOFF files can't have multiples text or data sections. The name of each type section must be .text, .data and .bss. This commit also updates cmd/internal/objfile/xcoff.go to retrieve Go sections using runtime symbols. Change-Id: Ib6315f19dad2d154a4531fc6508e7cbd8bc94743 Reviewed-on: https://go-review.googlesource.com/c/151037 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-10-31cmd: add XCOFF objfile and adapt cmd/nm testsClément Chigot
This commit adds a new file format in cmd/internal/objfile for XCOFF. It also adapts tests inside cmd/nm for AIX. Updates: #25893 Change-Id: I1e55ea0b7f7d08a871343bee27d11e2d3baad254 Reviewed-on: https://go-review.googlesource.com/c/145397 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-21cmd/link: support windows/armJordan Rhee
Enable the Go linker to generate executables for windows/arm. Generates PE relocation tables, which are used by Windows to dynamically relocate the Go binary in memory. Windows on ARM requires all modules to be relocatable, unlike x86/amd64 which are permitted to have fixed base addresses. Updates #26148 Change-Id: Ie63964ff52c2377e121b2885e9d05ec3ed8dc1cd Reviewed-on: https://go-review.googlesource.com/125648 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-03cmd/internal/objfile: only consider executable segments for load addressIan Lance Taylor
Reportedly on some new Fedora systems the linker is producing extra load segments, basically making the dynamic section non-executable. We were assuming that the first load segment could be used to determine the program's load offset, but that is no longer true. Use the first executable load segment instead. Fixes #26369 Change-Id: I5ee31ddeef2e8caeed3112edc5149065a6448456 Reviewed-on: https://go-review.googlesource.com/127895 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-16cmd/internal/objfile, debug/macho: support disassembling arm64 Mach-O objectsTobias Klauser
Fixes #25423 Change-Id: I6bed0726b8f4c7d607a3df271b2ab1006e96fa75 Reviewed-on: https://go-review.googlesource.com/113356 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-18cmd/internal/objfile: emit trailing tab outside of Disasm.DecodeJosh Bleecher Snyder
Disasm.Decode currently always appends a tab to the formatted instruction, although not to any relocations after it. Decode has two clients: objdump and pprof. pprof emits plain text, so it would be better not to have a trailing tab. objdump wants the trailing tab for text/tabwriter, but it is easy to add that to the Fprintf call. Shifting the responsibility for the trailing tab to the caller simplifies the code, increases correctness, and slightly improves performance by reducing and coalescing string concatenations. Change-Id: I0c85518ee185949e385de819e2e703bce757eba9 Reviewed-on: https://go-review.googlesource.com/106983 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-13cmd/internal/objfile: reuse tabwriter across symbols when disassemblingJosh Bleecher Snyder
Since the tabwriter is flushed at every symbol, it can be re-used with no impact on the output. This cuts allocated space when objdump-ing the compiler by almost 40%, and enables further upcoming improvements. It also speeds up objdump. name old time/op new time/op delta ObjdumpCompile 9.22s ± 3% 8.77s ± 3% -4.79% (p=0.000 n=10+9) Change-Id: Ief114d6c2680a4e762b5f439d3ca8dc7a89b9b27 Reviewed-on: https://go-review.googlesource.com/106978 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-12cmd/internal/objfile: clean up some commentsJosh Bleecher Snyder
Change-Id: Iba6feea74d65a961f30c12fb6c677ccd3b2c3591 Reviewed-on: https://go-review.googlesource.com/106695 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-06cmd: some semi-automated cleanupsDaniel Martí
* Remove some redundant returns * Replace HasPrefix with TrimPrefix * Remove some obviously dead code Passes toolstash -cmp on std cmd. Change-Id: Ifb0d70a45cbb8a8553758a8c4878598b7fe932bc Reviewed-on: https://go-review.googlesource.com/105017 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-26cmd: avoid unnecessary type conversionsKunpei Sakai
CL generated mechanically with github.com/mdempsky/unconvert. Also updated cmd/compile/internal/ssa/gen/*.rules manually. Change-Id: If721ef73cf0771ae83ce7e2d11623fc8d9155768 Reviewed-on: https://go-review.googlesource.com/97075 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29cmd/internal/objfile: make lookupFunc an alias typeCherry Zhang
In the x/arch repo, CL 45098 introduced SymLookup type, replacing the unnamed function type for lookup functions. This affects the signature of x86asm.GoSyntax. In particular, it cannot convert one named type, namely lookupFunc, to the other without an explicit cast. Make lookupFunc unnamed to fix. Change-Id: I973300d29ef1dbfdbd7fc2429e89c5849e6a7329 Reviewed-on: https://go-review.googlesource.com/80842 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-10cmd/objdump: pass the correct execution mode to x86asm.Decode in disasm_x86 ↵Hiroshi Ioka
on 386 Fixes #22093 Fixes #19988 Change-Id: Ibd8ec89e091fd527f363999e484676931d7aa6e2 Reviewed-on: https://go-review.googlesource.com/67450 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-02cmd/internal/objfile: allow disassemble amd64p32 binariesCherry Zhang
Change-Id: Ifa7701e97c0ec7d113e952b2b366edf422d6df2f Reviewed-on: https://go-review.googlesource.com/69351 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-09-21cmd/nm: accept macho files which don't have symbol table in the archiveHiroshi Ioka
After https://golang.org/cl/64793, we started to include Mach-O object files which don't have symbol table into cgo archive. However, toolchains didn't handle those files yet. Fixes #21959 Change-Id: Ibb2f6492f1fa59368f2dfd4cff19783997539875 Reviewed-on: https://go-review.googlesource.com/65170 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-21cmd/nm: handle cgo archiveHiroshi Ioka
This CL also make cmd/nm accept PE object file. Fixes #21706 Change-Id: I4a528b7d53da1082e61523ebeba02c4c514a43a7 Reviewed-on: https://go-review.googlesource.com/64890 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-28cmd/internal/objfile: add arm64 disassembler supportWei Xiao
Fixes #19157 Change-Id: Ieea286e8dc03929c3645f3113c33df569f8e26f3 Reviewed-on: https://go-review.googlesource.com/58930 Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-08-26all: remove some double spaces from commentsDaniel Martí
Went mainly for the ones that make no sense, such as the ones mid-sentence or after commas. Change-Id: Ie245d2c19cc7428a06295635cf6a9482ade25ff0 Reviewed-on: https://go-review.googlesource.com/57293 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-28cmd/internal: remove SymKind values that are only checked for, never setMichael Hudson-Doyle
Change-Id: Id152767c033c12966e9e12ae303b99f38776f919 Reviewed-on: https://go-review.googlesource.com/40987 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-04-27cmd/internal/objabi, cmd/link: move linker-only symkind values into linkerMichael Hudson-Doyle
Many (most!) of the values of objapi.SymKind are used only in the linker, so this creates a separate cmd/link/internal/ld.SymKind type, removes most values from SymKind and maps one to the other when reading object files in the linker. Two of the remaining objapi.SymKind values are only checked for, never set and so will never be actually found but I wanted to keep this to the most mechanical change possible. Change-Id: I4bbc5aed6713cab3e8de732e6e288eb77be0474c Reviewed-on: https://go-review.googlesource.com/40985 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>