]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] cmd/{compile,link}: backport fix for issue 39757
authorThan McIntosh <thanm@google.com>
Wed, 30 Sep 2020 16:52:47 +0000 (12:52 -0400)
committerCarlos Amedee <carlos@golang.org>
Fri, 23 Oct 2020 21:43:22 +0000 (21:43 +0000)
commit8f14c1840d15233b7f3d08f0acf0b0559d465a56
tree2b96768700f4dab1a43ad3ab04052c360b7241cd
parent1a05c910fbf62f6f06930394853e9cf7ca6087c6
[release-branch.go1.15] cmd/{compile,link}: backport fix for issue 39757

During Go 1.15 development, a fix was added to the toolchain for issue
information. The 1.15 line tables were slightly malformed in the way
that they used the DWARF "end sequence" operator, resulting in
incorrect line table info for the final instruction in the final
function of a compilation unit.

This problem was fixed in https://golang.org/cl/235739, which made it
into Go 1.15. It now appears that while the fix works OK for linux, in
certain cases it causes issues with the Darwin linker (the "address
not in any section" ld64 error reported in issue #40974).

During Go 1.16 development, the fix in https://golang.org/cl/235739
was revised so as to fix another related problem (described in issue #39757);
the newer fix does not trigger the problem in the Darwin linker however.

This CL back-ports the changes in https://golang.org/cl/239286 to the
1.15 release branch, so as to fix the Darwin linker error.

Updates #38192.
Updates #39757.
Fixes #40974.

Change-Id: I9350fec4503cd3a76b97aaea0d8aed1511662e29
Reviewed-on: https://go-review.googlesource.com/c/go/+/258422
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
src/cmd/internal/obj/dwarf.go
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/ld/dwarf_test.go
src/cmd/link/internal/ld/testdata/issue39757/issue39757main.go [new file with mode: 0644]