From: Cherry Zhang Date: Thu, 27 Oct 2016 18:33:58 +0000 (-0400) Subject: cmd/link: put text at address 0x1000000 on darwin/amd64 X-Git-Tag: go1.8beta1~486 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9d1efba28db4c045356c92c20f98cf12b5f31d72;p=gostls13.git cmd/link: put text at address 0x1000000 on darwin/amd64 Apparently on macOS Sierra LLDB thinks /usr/lib/dyld is mapped at address 0, even if Go code starts at 0x1000, and it looks up addresses from dyld which shadows Go symbols. Move Go binary at a higher address to avoid clash. Fixes #17463. Re-enable TestLldbPython. Change-Id: I89ca6f3ee48aa6da9862bfa0c2da91477cc93255 Reviewed-on: https://go-review.googlesource.com/32185 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Quentin Smith --- diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go index 1b1f4ac771..9646b60115 100644 --- a/src/cmd/link/internal/amd64/obj.go +++ b/src/cmd/link/internal/amd64/obj.go @@ -101,7 +101,7 @@ func archinit(ctxt *ld.Link) { *ld.FlagRound = 4096 } if *ld.FlagTextAddr == -1 { - *ld.FlagTextAddr = 4096 + int64(ld.HEADR) + *ld.FlagTextAddr = 0x1000000 + int64(ld.HEADR) } if *ld.FlagDataAddr == -1 { *ld.FlagDataAddr = 0 diff --git a/src/runtime/runtime-lldb_test.go b/src/runtime/runtime-lldb_test.go index f222ace1e3..98bc906666 100644 --- a/src/runtime/runtime-lldb_test.go +++ b/src/runtime/runtime-lldb_test.go @@ -139,7 +139,6 @@ intvar = 42 ` func TestLldbPython(t *testing.T) { - t.Skip("issue 17463") testenv.MustHaveGoBuild(t) if final := os.Getenv("GOROOT_FINAL"); final != "" && runtime.GOROOT() != final { t.Skip("gdb test can fail with GOROOT_FINAL pending")