mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] use per package filenames to build pclntab
In order to prevent renumbering of filenames in pclntab generation, use the per-package file list (previously only used for DWARF generation) as file-indices. This is the largest step to eliminate renumbering of filenames in pclntab. Note, this is probably not the final state of the file table within the object file. In this form, the linker loads all filenames for all objects. I'll move to storing the filenames as regular string symbols,and defaulting all string symbols to using the larger hash value to make generation of pcln simplest, and most memory friendly. Change-Id: I23daafa3f4b4535076e23100200ae0e7163aafe0 Reviewed-on: https://go-review.googlesource.com/c/go/+/245485 Run-TryBot: Jeremy Faller <jeremy@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
8370cbe64d
commit
9bdaf99966
16 changed files with 126 additions and 143 deletions
|
|
@ -1961,17 +1961,16 @@ func (fi *FuncInfo) NumFile() uint32 {
|
|||
return fi.lengths.NumFile
|
||||
}
|
||||
|
||||
func (fi *FuncInfo) File(k int) Sym {
|
||||
func (fi *FuncInfo) File(k int) goobj2.CUFileIndex {
|
||||
if !fi.lengths.Initialized {
|
||||
panic("need to call Preload first")
|
||||
}
|
||||
sr := (*goobj2.FuncInfo)(nil).ReadFile(fi.data, fi.lengths.FileOff, uint32(k))
|
||||
return fi.l.resolve(fi.r, sr)
|
||||
return (*goobj2.FuncInfo)(nil).ReadFile(fi.data, fi.lengths.FileOff, uint32(k))
|
||||
}
|
||||
|
||||
type InlTreeNode struct {
|
||||
Parent int32
|
||||
File Sym
|
||||
File goobj2.CUFileIndex
|
||||
Line int32
|
||||
Func Sym
|
||||
ParentPC int32
|
||||
|
|
@ -1991,7 +1990,7 @@ func (fi *FuncInfo) InlTree(k int) InlTreeNode {
|
|||
node := (*goobj2.FuncInfo)(nil).ReadInlTree(fi.data, fi.lengths.InlTreeOff, uint32(k))
|
||||
return InlTreeNode{
|
||||
Parent: node.Parent,
|
||||
File: fi.l.resolve(fi.r, node.File),
|
||||
File: node.File,
|
||||
Line: node.Line,
|
||||
Func: fi.l.resolve(fi.r, node.Func),
|
||||
ParentPC: node.ParentPC,
|
||||
|
|
@ -2060,10 +2059,10 @@ func (l *Loader) Preload(localSymVersion int, f *bio.Reader, lib *sym.Library, u
|
|||
lib.Autolib = append(lib.Autolib, r.Autolib()...)
|
||||
|
||||
// DWARF file table
|
||||
nfile := r.NDwarfFile()
|
||||
unit.DWARFFileTable = make([]string, nfile)
|
||||
for i := range unit.DWARFFileTable {
|
||||
unit.DWARFFileTable[i] = r.DwarfFile(i)
|
||||
nfile := r.NFile()
|
||||
unit.FileTable = make([]string, nfile)
|
||||
for i := range unit.FileTable {
|
||||
unit.FileTable[i] = r.File(i)
|
||||
}
|
||||
|
||||
l.addObj(lib.Pkg, or)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue