Commit 402dd10a authored by David Chase's avatar David Chase

cmd/link: revert DWARF version to 2 for .debug_lines

On OSX 10.12 and earlier, paired with XCode 9.0,
specifying DWARF version 3 causes dsymutil to misbehave.
Version 2 appears to be good enough to allow processing
of the prologue_end opcode on (at least one version of)
Linux and OSX 10.13.

Fixes #25451.

Change-Id: Ic760e34248393a5386be96351c8e492da1d3413b
Reviewed-on: https://go-review.googlesource.com/114015Reviewed-by: 's avatarAlessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 685ecc7f
......@@ -1158,7 +1158,7 @@ func writelines(ctxt *Link, lib *sym.Library, textp []*sym.Symbol, ls *sym.Symbo
unitLengthOffset := ls.Size
ls.AddUint32(ctxt.Arch, 0) // unit_length (*), filled in at end.
unitstart = ls.Size
ls.AddUint16(ctxt.Arch, 3) // dwarf version (appendix F)
ls.AddUint16(ctxt.Arch, 2) // dwarf version (appendix F) -- version 3 is incompatible w/ XCode 9.0's dsymutil, latest supported on OSX 10.12 as of 2018-05
headerLengthOffset := ls.Size
ls.AddUint32(ctxt.Arch, 0) // header_length (*), filled in at end.
headerstart = ls.Size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment