mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/internal/obj: avoid duplicate file name symbols
The meaning of Version=1 was overloaded: it was reserved for file name symbols (to avoid conflicts with non-file name symbols), but was also used to mean "give me a fresh version number for this symbol." With the new inlining tree, the same file name symbol can appear in multiple entries, but each one would become a distinct symbol with its own version number. Now, we avoid duplicating symbols by using Version=0 for file name symbols and we avoid conflicts with other symbols by prefixing the symbol name with "gofile..". Change-Id: I8d0374053b8cdb6a9ca7fb71871b69b4dd369a9c Reviewed-on: https://go-review.googlesource.com/37234 Run-TryBot: David Lazar <lazard@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
781fd3998e
commit
301149b9e4
5 changed files with 8 additions and 11 deletions
|
|
@ -114,7 +114,8 @@ func numberfile(ctxt *Link, file *Symbol) {
|
|||
ctxt.Filesyms = append(ctxt.Filesyms, file)
|
||||
file.Value = int64(len(ctxt.Filesyms))
|
||||
file.Type = obj.SFILEPATH
|
||||
file.Name = expandGoroot(file.Name)
|
||||
path := file.Name[len(obj.FileSymPrefix):]
|
||||
file.Name = expandGoroot(path)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue