diff options
author | Than McIntosh <thanm@google.com> | 2020-04-13 15:38:03 -0400 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2020-04-14 19:36:56 +0000 |
commit | eed3ef581b136adcfb0ca36e1238960de599f3e5 (patch) | |
tree | c83f75e72c1d31115e930141332db243d59aa14e /src/cmd/link/internal/loader/loader.go | |
parent | 3216d14f78e3a6e26cddd9c7d91a26a34c835de9 (diff) | |
download | go-eed3ef581b136adcfb0ca36e1238960de599f3e5.tar.gz go-eed3ef581b136adcfb0ca36e1238960de599f3e5.zip |
[dev.link] cmd/link: hoist dwarfGenerateDebugSyms out of dodata()
Hoist dwarfGenerateDebugSyms call up out of dodata to before
loadlibfull. This required a couple of small tweaks to the
loader and to loadlibfull.
Change-Id: I48ffb450d2e48b9e55775b73a6debcd27dbb7b9c
Reviewed-on: https://go-review.googlesource.com/c/go/+/228221
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/link/internal/loader/loader.go')
-rw-r--r-- | src/cmd/link/internal/loader/loader.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index ff5d8ed322..3b77aa70e1 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -2204,13 +2204,15 @@ func loadObjSyms(l *Loader, syms *sym.Symbols, r *oReader) int { name := strings.Replace(osym.Name(r.Reader), "\"\".", r.pkgprefix, -1) t := sym.AbiSymKindToSymKind[objabi.SymKind(osym.Type())] // NB: for the test below, we can skip most anonymous symbols - // since they will never be turned into sym.Symbols (ex: - // funcdata), however DWARF subprogram DIE symbols (which are - // nameless) will eventually need to be turned into - // sym.Symbols (with relocations), so the simplest thing to do - // is include them as part of this loop. - if name == "" && t != sym.SDWARFINFO { - continue + // since they will never be turned into sym.Symbols (eg: + // funcdata). DWARF symbols are an exception however -- we + // want to include all reachable but nameless DWARF symbols. + if name == "" { + switch t { + case sym.SDWARFINFO, sym.SDWARFRANGE, sym.SDWARFLOC, sym.SDWARFLINES: + default: + continue + } } ver := abiToVer(osym.ABI(), r.version) if t == sym.SXREF { |