diff options
| author | Jeremy Quirke <qjeremy@uber.com> | 2022-08-09 17:20:33 +0000 |
|---|---|---|
| committer | Than McIntosh <thanm@google.com> | 2022-08-11 14:11:53 +0000 |
| commit | 2340d371796f95acdcc399e60f9ecefec2add8df (patch) | |
| tree | 75abf1745f148d3a8a6fa9e2c68c29646ae7df31 /src/cmd/link/internal/loader/loader.go | |
| parent | a1337ef40cfa71625595b5b7f10b15341c1240f2 (diff) | |
| download | go-2340d371796f95acdcc399e60f9ecefec2add8df.tar.xz | |
cmd/link: fix trampolines breaking DWARF line info
When trampolines are needed (e.g. Darwin ARM64), the DWARF LPT (Line
Program Table - see DWARF section 6.1) generation fails because the
replacement symbols are marked as external symbols and skipped during
the DWARF LPT generation phase.
Fixes #54320
Change-Id: I6c93f5378f50e5edf30d5121402a48214abb1ce2
GitHub-Last-Rev: 085bbc55dbc95d55456cc2acc46a0d02416c2848
GitHub-Pull-Request: golang/go#54321
Reviewed-on: https://go-review.googlesource.com/c/go/+/422154
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/link/internal/loader/loader.go')
| -rw-r--r-- | src/cmd/link/internal/loader/loader.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index 52c7d72835..c2baa20d8d 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -1611,13 +1611,8 @@ func (l *Loader) GetFuncDwarfAuxSyms(fnSymIdx Sym) (auxDwarfInfo, auxDwarfLoc, a if l.SymType(fnSymIdx) != sym.STEXT { log.Fatalf("error: non-function sym %d/%s t=%s passed to GetFuncDwarfAuxSyms", fnSymIdx, l.SymName(fnSymIdx), l.SymType(fnSymIdx).String()) } - if l.IsExternal(fnSymIdx) { - // Current expectation is that any external function will - // not have auxsyms. - return - } - r, li := l.toLocal(fnSymIdx) - auxs := r.Auxs(li) + r, auxs := l.auxs(fnSymIdx) + for i := range auxs { a := &auxs[i] switch a.Type() { |
