8e5ac83d43
https://golang.org/cl/5822049 introduced the idea of linking together all the cgo objects with -r, while also linking against -lgcc. This was to fix http://golang.org/issue/3261: cgo code that requires libgcc would break when using internal linking. This approach introduced https://golang.org/issue/9510: multiple different cgo packages could include the same libgcc object, leading to a multiple definition error during the final link. That problem was fixed by https://golang.org/cl/16741, as modified by https://golang.org/cl/16993, which did the link against libgcc only during the final link. After https://golang.org/cl/16741, and, on Windows, the later https://golang.org/cl/26670, ld -r no longer does anything useful. So, remove it. Doing this revealed that running ld -r on Darwin simplifies some relocs by making them specific to a symbol rather than a section. Correct the handling of unsigned relocations in internal linking mode by offsetting by the symbol value. This only really comes up when using the internal linker with C code that initializes a variable to the address of a local constant, such as a C string (as in const char *s = "str";). This change does not affect the normal case of external linking, where the Add field is ignored. The test case is misc/cgo/test/issue6612.go in internal linking mode. The cmd/internal/goobj test can now see an external object with no symbol table; fix it to not crash in that case. Change-Id: I15e5b7b5a8f48136bc14bf4e1c4c473d5eb58062 Reviewed-on: https://go-review.googlesource.com/64793 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.