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>
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).
}
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