aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/arm64
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2022-03-23 18:57:16 -0400
committerCherry Mui <cherryyz@google.com>2022-03-24 14:44:47 +0000
commitcccfb8ffdb97224aed5cc718d4bac3f3df9e55ed (patch)
tree2b8e616a06acb4ace8355e4985cecb5389b94d8a /src/cmd/link/internal/arm64
parent0ed31eb73b13bd57aff727f4ab759c6701d45a01 (diff)
downloadgo-cccfb8ffdb97224aed5cc718d4bac3f3df9e55ed.tar.xz
cmd/link: do not add label symbols for DWARF on Windows/ARM64
Label symbols are only useful for relocations from text. No need to do it for DWARF. And the PE symbol table doesn't like them. May fix #51903. Change-Id: Ibe6ea880d8533ba1dcc017030072c7dffee0e9e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/395215 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/link/internal/arm64')
-rw-r--r--src/cmd/link/internal/arm64/asm.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/link/internal/arm64/asm.go b/src/cmd/link/internal/arm64/asm.go
index abae0f87bc..229a4d300b 100644
--- a/src/cmd/link/internal/arm64/asm.go
+++ b/src/cmd/link/internal/arm64/asm.go
@@ -1146,7 +1146,8 @@ func gensymlate(ctxt *ld.Link, ldr *loader.Loader) {
if !ldr.AttrReachable(s) {
continue
}
- if ldr.SymType(s) == sym.STEXT {
+ t := ldr.SymType(s)
+ if t == sym.STEXT {
if ctxt.IsDarwin() || ctxt.IsWindows() {
// Cannot relocate into middle of function.
// Generate symbol names for every offset we need in duffcopy/duffzero (only 64 each).
@@ -1159,6 +1160,9 @@ func gensymlate(ctxt *ld.Link, ldr *loader.Loader) {
}
continue // we don't target the middle of other functions
}
+ if t >= sym.SDWARFSECT {
+ continue // no need to add label for DWARF symbols
+ }
sz := ldr.SymSize(s)
if sz <= limit {
continue