]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.link] cmd/link: set direct fn address in dwarf gen where possible
authorThan McIntosh <thanm@google.com>
Thu, 16 Apr 2020 12:29:43 +0000 (08:29 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 16 Apr 2020 15:40:34 +0000 (15:40 +0000)
commitda9f383ca1d9c7c7011f8d32a55d06f4cebfd623
tree01b0b0b80eec585fd1e2dbb4a8abab9a97f37b9a
parent4a0bca37d2d6696a1bf4a64bf8773c586c5eef39
[dev.link] cmd/link: set direct fn address in dwarf gen where possible

If we are internal linking a static executable, and address assignment
has happened, then when emitting some parts of DWARF we can just emit
a function address directly instead of generating a relocation. For
external linking or other build modes, we are generating a relocatable
binary so we still need to emit relocations.

This CL inspired by Cherry's similar CL for pclntab at
https://go-review.googlesource.com/c/go/+/228478.

Change-Id: Ib03fbe2dd72d0ba746bf46015e0f2d6c3f3d53ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/228537
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/loader/symbolbuilder.go