commit | d532d5f0fade2630612a5bdb0ac3f95824266ad5 | [log] [tgz] |
---|---|---|
author | Cherry Zhang <cherryyz@google.com> | Tue Feb 11 18:26:38 2020 -0500 |
committer | Cherry Zhang <cherryyz@google.com> | Fri Feb 21 22:30:06 2020 +0000 |
tree | 356638aa8c13621f1ec39190cdb636855b5bdba8 | |
parent | 240498d63551d0a58a71d5ada457c73a71983a7c [diff] |
cmd/link: also apply R_ADDR relocation statically when internal linking PIE When internal linking PIE, R_ADDR relocations cannot be resolved statically so we generate dynamic relocations for it. We don't apply the relocations statically, so the bytes in the file are left unset (likely zero). This makes some tool that examines the file statically, e.g. go version, to fail to find the referenced addresses. This CL makes the linker also apply the relocations to the file content, so it holds the correct offsets and so can be examined statically. Fixes #37173. Change-Id: Ia5c6b661f1a91a232843ca4224264bfd7a5509eb Reviewed-on: https://go-review.googlesource.com/c/go/+/219199 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
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.
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.
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.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses 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.