]> Cypherpunks repositories - gostls13.git/commit
cmd/link/internal/ld: skip DWARF combining for iOS binaries
authorElias Naur <elias.naur@gmail.com>
Thu, 3 May 2018 13:38:37 +0000 (15:38 +0200)
committerElias Naur <elias.naur@gmail.com>
Fri, 4 May 2018 15:39:02 +0000 (15:39 +0000)
commitbcdbd58ce48d71cb912238caaa193d832901e227
tree366933a7b847243d987fca6180a4228eae8a7125
parent506d6a32cecfed3f3b310f9b0d3de10205c17852
cmd/link/internal/ld: skip DWARF combining for iOS binaries

The macOS and iOS external linker strips DWARF information from
binaries because it assumes the information will go into separate
DWARF information .dSYM files. To preserve the embedded debugging
information, the Go linker re-combines the separate DWARF
information into the unmapped __DWARF segment of the final
executable.

However, the iOS dyld linker does not allow unmapped segments, so
use the presence of the LC_VERSION_MIN_IPHONEOS linker command to
skip DWARF combining. Note that we can't use GOARCH for detection
since the iOS emulator runs on  GOARCH=386 and GOARCH=amd64 and we
will run into https://golang.org/issues/25148.

Updates #25148.

Change-Id: I29a1bc468fdee74ab3b27c46931501a0a8120c66
Reviewed-on: https://go-review.googlesource.com/111275
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/dwarf_test.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/macho_combine_dwarf.go