An error occurred fetching the project authors.
- 31 Oct, 2015 1 commit
-
-
Ian Lance Taylor authored
The GNU binutils recently picked up support for new 386/amd64 relocations. Add support for them in the Go linker when doing an internal link. The 386 relocation R_386_GOT32X was proposed in https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I . It can be treated as identical to the R_386_GOT32 relocation. The amd64 relocations R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were proposed in https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0 . They can both be treated as identical to the R_X86_64_GOTPCREL relocation. The purpose of the new relocations is to permit additional linker relaxations in some cases. We do not attempt to support those cases. While we're at it, remove the unused and in some cases out of date _COUNT names from ld/elf.go. Fixes #13114. Change-Id: I34ef07f6fcd00cdd2996038ecf46bb77a49e968b Reviewed-on: https://go-review.googlesource.com/16529Reviewed-by: Minux Ma <minux@golang.org>
-
- 29 Oct, 2015 1 commit
-
-
Michael Hudson-Doyle authored
When dynamically linking, we want references to functions defined in this module to always be to the function object, not to the PLT. We force this by writing an additional local symbol for every global function symbol and making all relocations against the global symbol refer to this local symbol instead. This is approximately equivalent to the ELF linker -Bsymbolic-functions option, but that is buggy on several platforms. Change-Id: Ie6983eb4d1947f8543736fd349f9a90df3cce91a Reviewed-on: https://go-review.googlesource.com/16436Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 28 Oct, 2015 2 commits
-
-
Michael Hudson-Doyle authored
Change-Id: Iaf9159a68fa395245bc20ccb4a2a377f89371a7e Reviewed-on: https://go-review.googlesource.com/13996Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Michael Hudson-Doyle authored
Fixes #10560 Change-Id: Iedffd9c236c4fbb386c3afc52c5a1457f96ef122 Reviewed-on: https://go-review.googlesource.com/13991Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
- 19 Oct, 2015 1 commit
-
-
David Crawshaw authored
For #10807 Change-Id: Ied826d06cb622edf6413b6f2cdcc46987ab0b05a Reviewed-on: https://go-review.googlesource.com/16054Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 08 Oct, 2015 1 commit
-
-
Michael Hudson-Doyle authored
It's particularly nice to get rid of the android special cases in the linker. Change-Id: I516363af7ce8a6b2f196fe49cb8887ac787a6dad Reviewed-on: https://go-review.googlesource.com/14197 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 06 Oct, 2015 1 commit
-
-
Michael Hudson-Doyle authored
It is generally expected that the ELF flags of a dynamically linked executable and the libraries it links against match. Go's linker currently always produces executables with flags that do not declare a float abi (hard, soft) at all, but when cgo is involved it is unlikely that this matches the system libraries being linked against -- really the decision about ABI is made by the C compiler during the invocation of cgo. This change is basically a port of the code from binutils that parses the ".ARM.attributes" section to check for the tag that declares that the code is built for the hard-float ABI. Fixes #7094 Change-Id: I737c8f3b5ed4af545cfc3e86722d03eb83083402 Reviewed-on: https://go-review.googlesource.com/14860 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-
- 08 Sep, 2015 1 commit
-
-
Michael Hudson-Doyle authored
Currently Go produces shared libraries that cannot be shared between processes because they have relocations against the text segment (not text section). This fixes this by moving some data to sections with magic names recognized by the static linker. The change in genasmsym to add STYPELINK to the switch should fix things on darwin/arm64. Fixes #10914 Updates #9210 Change-Id: Iab4a6678dd04cec6114e683caac5cf31b1063309 Reviewed-on: https://go-review.googlesource.com/14306 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 04 Sep, 2015 3 commits
-
-
Shawn Walker-Salas authored
TestNoteReading fails on Solaris with linkmode=external due to some assumptions made about how ELF .note sections are written by some linkers. On current versions of Solaris and older derivatives, SHF_ALLOC is intentionally ignored for .note sections unless the .note section is assigned to the text segment via a mapfile. Also, if .note sections are assigned to the text segment, no PT_NOTE program header will be created thwarting Go's attempts at attempting to quickly find the .note. Furthermore, Go assumes that the relevant note segment will be placed early in the file while the Solaris linker currently places the note segment last in the file, additionally thwarting Go's optimisation attempts that read only the first 16KB of the file to find the buildid. The fix is to detect when the note section is outside of the first 16KB of the file and then fallback to additionally reading that section of the file. This way, in future versions of Solaris when this linking behaviour is changed, the fast path will always succeed and we'll only be slower if it fails; likewise, any other linker that does this will also just work. Fixes #12178 Change-Id: I61c1dc3f744ae3ad63938386d2ace8a432c0efe1 Reviewed-on: https://go-review.googlesource.com/14210 Run-TryBot: Aram Hăvărneanu <aram@mgk.ro> Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
-
Dave Cheney authored
Revert "cmd/internal/ld: put read-only relocated data into .data.rel.ro when making a shared object" This reverts commit 2c2cbb69. Broke darwin/arm64 Change-Id: Ibd2dea475d6ce6a8b4b40e2da19a83fc0514025d Reviewed-on: https://go-review.googlesource.com/14301Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Hudson-Doyle authored
Currently Go produces shared libraries that cannot be shared between processes because they have relocations against the text segment (not text section). This fixes this by moving some data to sections with magic names recognized by the static linker. Fixes #10914 Updates #9210 Change-Id: I7178daadc0ae87953d5a084aa3d580f4e3b46d47 Reviewed-on: https://go-review.googlesource.com/10300 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 03 Sep, 2015 1 commit
-
-
Michael Hudson-Doyle authored
cmd/internal/obj: some platform independent bits of proper toolchain support for thread local storage Also simplifies some silliness around making the .tbss section wrt internal vs external linking. The "make TLS make sense" project has quite a few more steps to go. Issue #11270 Change-Id: Ia4fa135cb22d916728ead95bdbc0ebc1ae06f05c Reviewed-on: https://go-review.googlesource.com/13990Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 31 Jul, 2015 1 commit
-
-
Russ Cox authored
Etcd and kubernetes have hit this. See https://bugzilla.redhat.com/show_bug.cgi?id=1248071 Change-Id: I6231013efa0a19ee74f7ebacd1024adb368af83a Reviewed-on: https://go-review.googlesource.com/12951Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 11 Jul, 2015 1 commit
-
-
Brad Fitzpatrick authored
The one in misc/makerelease/makerelease.go is particularly bad and probably warrants rotating our keys. I didn't update old weekly notes, and reverted some changes involving test code for now, since we're late in the Go 1.5 freeze. Otherwise, the rest are all auto-generated changes, and all manually reviewed. Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d Reviewed-on: https://go-review.googlesource.com/12048Reviewed-by: Rob Pike <r@golang.org>
-
- 29 Jun, 2015 1 commit
-
-
Russ Cox authored
This code used to only be run for ELF, with the predictable result that using -s with external linking broke on Windows and OS X. Moving it here should fix Windows and does fix OS X. CL 10835 also claims to fix the crash on Windows. I don't know whether it does so correctly, but regardless, this CL should make that one a no-op. Fixes #10254. Change-Id: I2e7b45ab0c28568ddbb1b50581dcc157ae0e7ffe Reviewed-on: https://go-review.googlesource.com/11695Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
- 05 Jun, 2015 2 commits
-
-
Russ Cox authored
Other binary formats to follow. Using our own note instead of the GNU build ID note because we are not the GNU project, and I can't guarantee that the semantics of our note and the semantics of the GNU note will match forever. (Also they don't match today.) For #11048. Change-Id: Iec7e5a2e49d52b6d3a51b0aface2de7c77a45491 Reviewed-on: https://go-review.googlesource.com/10706Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Change-Id: I038e892725836ab7718f7638e8ad5712953f2cb5 Reviewed-on: https://go-review.googlesource.com/10704Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 27 May, 2015 3 commits
-
-
Michael Hudson-Doyle authored
The motivation for this is the innocuous looking test case that is added. This creates a stack exe -> libdep2.so -> libdep.so -> libruntime.so. The problem comes from the fact that a function from libdep.so gets inlined all the way into exe. This (unsurprisingly) means that the object file for exe references symbols from libdep.so, which means that -ldep needs to be passed when linking exe and it isn't. The fix is simply to pass it -- there is no harm in passing it when it's not needed. The thing is, it's not clear at all in the current code to see how the linker can know that libdep2 is linked against libdep. It could look through the DT_NEEDED entries in libdep2 and try to guess which are Go libraries, but it feels better to be explicit. So this adds another SHT_NOTE section that lists the shared libraries a shared library was linked against, and makes sure the complete set of depended upon shared libraries is passed to the external linker. Change-Id: I79aa6f98b4db4721d657a7eb7b7f062269bf49e2 Reviewed-on: https://go-review.googlesource.com/10376Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Hudson-Doyle authored
This makes for a more stable API for tools (including cmd/link itself) to extract the abi hash from a shared library and makes it possible at all for a library that has had the local symbol table removed. The existing note-writing code only supports writing notes into the very start of the object file so they are easy to find in core dumps. This doesn't apply to the "go" notes and means that all notes have to fit into a fixed size budget. That's annoying now we have more notes (and the next CL will add another one) so this does a little bit of work to make adding notes that do not have to go at the start of the file easier and moves the writing of the package list note over to that mechanism, which lets me revert a hack that increased the size budget mentioned above for -buildmode=shared builds. Change-Id: I6077a68d395c8a2bc43dec8506e73c71ef77d9b9 Reviewed-on: https://go-review.googlesource.com/10375Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Hudson-Doyle authored
The LSym.Section and Section.Elfsect fields were defined as interface{} but always had the same concrete type (*Section and *ElfShdr respectively) so just define them with that type. Reduces size of LSym from 328 to 320 bytes and reduces best-of-10 maxresident size from 246028k to 238036k when linking libstd.so. Change-Id: Ie7112c53e4c2c7ce5fe233b81372aa5633f572e8 Reviewed-on: https://go-review.googlesource.com/10410Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 21 May, 2015 1 commit
-
-
Russ Cox authored
Trivial merging of 5g, 6g, ... into go tool compile, and similarlly 5l, 6l, ... into go tool link. The files compile/main.go and link/main.go are new. Everything else in those directories is a move followed by change of imports and package name. This CL breaks the build. Manual fixups are in the next CL. See golang-dev thread titled "go tool compile, etc" for background. Change-Id: Id35ff5a5859ad9037c61275d637b1bd51df6828b Reviewed-on: https://go-review.googlesource.com/10287Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Rob Pike <r@golang.org>
-
- 15 May, 2015 1 commit
-
-
Michael Hudson-Doyle authored
The only essential difference is elf32 vs elf64, I assume the other differences are bugs in one version or another... Change-Id: Ie6ff33d5574a6592b543df9983eff8fdf88c97a1 Reviewed-on: https://go-review.googlesource.com/10001 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Russ Cox <rsc@golang.org>
-
- 06 May, 2015 1 commit
-
-
Michael Hudson-Doyle authored
My last update to https://golang.org/cl/9710 missed this. Change-Id: Ie042032ca307e1065fcf6c402a166f9ff74027e7 Reviewed-on: https://go-review.googlesource.com/9771Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 05 May, 2015 1 commit
-
-
Michael Hudson-Doyle authored
This makes the intermediate object file a little bigger but it doesn't waste any space in the final shared library. Fixes #10691 Change-Id: Ic51a571d60291f1ac2dad1b50dba4679643168ae Reviewed-on: https://go-review.googlesource.com/9710Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 30 Apr, 2015 1 commit
-
-
Michael Hudson-Doyle authored
Change-Id: I611f7dec2109dc7e2f090ced0a1dca3d4b577134 Reviewed-on: https://go-review.googlesource.com/9520Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
- 29 Apr, 2015 1 commit
-
-
David Crawshaw authored
Removes the unused *bufio.Reader from the object controlling the linker's primary output. Change-Id: If91d9f60752f3dc4b280f35d6eb441f3c47574b2 Reviewed-on: https://go-review.googlesource.com/9362Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 23 Apr, 2015 1 commit
-
-
Josh Bleecher Snyder authored
They are vestiges of the c2go transition. Change-Id: I22672e40373ef77d7a0bf69cfff8017e46353055 Reviewed-on: https://go-review.googlesource.com/9265Reviewed-by: Minux Ma <minux@golang.org>
-
- 20 Apr, 2015 1 commit
-
-
Matthew Dempsky authored
The majority of this CL was prepared via scripted invocations of `gofmt -w -r "$SYM -> obj.$SYM" cmd/internal/ld/*.go` and `gofmt -w -r "ld.$SYM -> obj.$SYM" cmd/?l/*.go`. Because of issue #7417, that was followed by repeatedly running an AWK script to identify lines that differed other than whitespace changes or "ld." or "obj." prefixes and manually restoring comments. Finally, the redundant constants from cmd/internal/ld/link.go were removed, and "goimports -w" was used to cleanup import lines. Passes rsc.io/toolstash/buildall, even when modified to also build cmd. Fixes #10055. Change-Id: Icd5dbe819a3b6520ce883748e60017dc8e9a2e85 Reviewed-on: https://go-review.googlesource.com/9112Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 17 Apr, 2015 1 commit
-
-
David Crawshaw authored
I have left the Diag calls in place where I believe Ctxt.Cursym != nil which means this CL is not the improvement I had hoped for. However it is now safe to call Exitf whereever you are in the linker, which makes it easier to reason about some code. Change-Id: I8261e761ca9719f7d216e2747314adfe464e3337 Reviewed-on: https://go-review.googlesource.com/8668Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 15 Apr, 2015 2 commits
-
-
Michael Hudson-Doyle authored
Change-Id: I09e84161d106960a69972f5fc845a1e40c28e58f Reviewed-on: https://go-review.googlesource.com/8331 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Hudson-Doyle authored
Including having -r "" preventing rpath from being set at all. Change-Id: Ib40d7bf93a6e9ef21985c4a05b5703e4fbd1cd1b Reviewed-on: https://go-review.googlesource.com/8806Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 12 Apr, 2015 1 commit
-
-
David Crawshaw authored
Uses ar to create an archive when -buildmode=c-archive. A small example (that I hope to turn into a test in a later CL): goarchive.go: package main import "fmt" import "C" func init() { fmt.Println("ran go init") } //export FuncInGo func FuncInGo() { fmt.Println("called a go function") } func main() { fmt.Println("in main") } This can be compiled with: go build -ldflags=-buildmode=c-archive -o=libgo.a goarchive.go main.c: #include <stdio.h> extern void FuncInGo(); int main(void) { printf("c hello\n"); FuncInGo(); printf("c goodbye\n"); return 0; } Can be compiled with: cc main.c libgo.a Apple provide a warning about the lack of PIE, but still produce a binary which runs and outputs (on darwin/amd64): c hello ran go init called a go function c goodbye Change-Id: I7611925f210a83afa6bd1e66a5601dd636a428c8 Reviewed-on: https://go-review.googlesource.com/8711Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 09 Apr, 2015 1 commit
-
-
Michael Hudson-Doyle authored
Change-Id: Id4997d611ced29397133f14def6abc88aa9e811e Reviewed-on: https://go-review.googlesource.com/8252 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 08 Apr, 2015 4 commits
-
-
Michael Hudson-Doyle authored
The linker currently (on some platforms) takes a -shared flag, which means approximately what -buildmode=c-shared means in the in the proposed "Go Execution Modes" document. As part of implementing other modes, the term "shared" becomes horribly overloaded, so this replaces -shared with a -buildmode argument instead (which currently only handles -buildmode=c-shared and the default -buildmode=exe -- no new behaviour here). As the linker support for -shared was in 1.4 this retains it as an alias. Change-Id: Id2ebb8e05ee07f46208a554bc2622d0e67b47082 Reviewed-on: https://go-review.googlesource.com/8304Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Change-Id: Iaf2dba7d699a8d52f91ce10222ab0d1a0f1f21fc Reviewed-on: https://go-review.googlesource.com/8625Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Shenghou Ma authored
This CL introduces R_ADDRARM64, which is similar to R_ADDRPOWER. Fixes #10112. Change-Id: I309e3df7608b9eef9339196fdc50dedf5f9439f1 Reviewed-on: https://go-review.googlesource.com/8438Reviewed-by: Aram Hăvărneanu <aram@mgk.ro> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
Shenghou Ma authored
Based on Michael Hudson-Doyle's patch: https://github.com/4ad/go/commit/b735215ee41b4237ec393d4669f6f55d4b27babc Change-Id: I309e3df7608b9eef9339196fdc50dedf5f9439f0 Reviewed-on: https://go-review.googlesource.com/8437Reviewed-by: Aram Hăvărneanu <aram@mgk.ro> Reviewed-by: David Crawshaw <crawshaw@golang.org>
-
- 01 Apr, 2015 1 commit
-
-
Josh Bleecher Snyder authored
The c2go translation left a lot of case expressions on separate lines. Merge expressions onto single lines subject to these constraints: * Max 4 clauses, all literals or names * Don't move expressions with comments The change was created by running http://play.golang.org/p/yHajs72h-g: $ mergecase cmd/internal/{ld,gc,obj}/*.go cmd/internal/obj/*/*.go Passes toolstash -cmp. Change-Id: Iba41b390d302e5486e5dc6ba7599a92270676556 Reviewed-on: https://go-review.googlesource.com/7593Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
-
- 17 Mar, 2015 1 commit
-
-
Russ Cox authored
These were introduced during C -> Go translation when the loop increment contained multiple statements. Change-Id: Ic8abd8dcb3308851a1f7024de00711f0f984e684 Reviewed-on: https://go-review.googlesource.com/7627Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Rob Pike <r@golang.org>
-
- 16 Mar, 2015 1 commit
-
-
Aram Hăvărneanu authored
Only internal linking without cgo is supported for now. Change-Id: I91eb1572c1ccc805db62fc4c29080df98797d51a Reviewed-on: https://go-review.googlesource.com/7048Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-