diff options
| author | Mark Freeman <mark@golang.org> | 2025-05-19 16:06:42 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-05-20 12:55:36 -0700 |
| commit | fa42585dadb8d70191820549435820cb70691cf6 (patch) | |
| tree | 4ef28dcd50c108e7d37d841537703aa5470821bf /src/cmd/compile/internal/noder | |
| parent | 96d2211c61189f056fa3c7c8d8abb351596c0f2c (diff) | |
| download | go-fa42585dadb8d70191820549435820cb70691cf6.tar.xz | |
internal/pkgbits: rename RelocEnt to RefTableEntry
Change-Id: I9b1c9a0499ad3444e8cb3e4be187f9fab816c90c
Reviewed-on: https://go-review.googlesource.com/c/go/+/674159
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <mark@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/internal/noder')
| -rw-r--r-- | src/cmd/compile/internal/noder/doc.go | 30 | ||||
| -rw-r--r-- | src/cmd/compile/internal/noder/linker.go | 4 |
2 files changed, 15 insertions, 19 deletions
diff --git a/src/cmd/compile/internal/noder/doc.go b/src/cmd/compile/internal/noder/doc.go index a35efa886d..f76e5723b7 100644 --- a/src/cmd/compile/internal/noder/doc.go +++ b/src/cmd/compile/internal/noder/doc.go @@ -59,7 +59,7 @@ contains exactly two elements — a public root and a private root. The public root element identifies the package and provides references for all exported objects it contains. - PublicRoot = Relocs + PublicRoot = RefTable [ Sync ] PkgRef [ HasInit ] @@ -79,7 +79,7 @@ A base is either a file base or line base (produced by a line directive). Every base has a position, line, and column; these are constant for file bases and hence not encoded. - PosBase = Relocs + PosBase = RefTable [ Sync ] StringRef // the (absolute) file name for the base Bool // true if a file base, else a line base @@ -118,7 +118,7 @@ packages. The below package paths have special meaning. | "unsafe" | the compiler-known unsafe package | +--------------+-----------------------------------+ - Pkg = Relocs + Pkg = RefTable [ Sync ] StringRef // path // The below is ommitted for the special package paths @@ -138,21 +138,17 @@ Note, a PkgRef is *not* equivalent to Ref[Pkg] due to an extra marker. # References A reference table precedes every element. Each entry in the table -contains a section / index pair denoting the location of the referenced -element. +contains a (section, index) pair denoting the location of the +referenced element. - // TODO(markfreeman): Rename to RefTable. - Relocs = [ Sync ] - RelocCount - { Reloc } - . - // TODO(markfreeman): Rename to RefTableEntryCount. - RelocCount = Uint64 . - // TODO(markfreeman): Rename to RefTableEntry. - Reloc = [ Sync ] - SectionKind - RelIndex - . + RefTable = [ Sync ] + Uint64 // the number of table entries + { RefTableEntry } + . + RefTableEntry = [ Sync ] + SectionKind + RelIndex + . Elements encode references to other elements as an index in the reference table — not the location of the referenced element directly. diff --git a/src/cmd/compile/internal/noder/linker.go b/src/cmd/compile/internal/noder/linker.go index 6ee29a205b..51b03a1897 100644 --- a/src/cmd/compile/internal/noder/linker.go +++ b/src/cmd/compile/internal/noder/linker.go @@ -47,8 +47,8 @@ type linker struct { // relocAll ensures that all elements specified by pr and relocs are // copied into the output export data file, and returns the // corresponding indices in the output. -func (l *linker) relocAll(pr *pkgReader, relocs []pkgbits.RelocEnt) []pkgbits.RelocEnt { - res := make([]pkgbits.RelocEnt, len(relocs)) +func (l *linker) relocAll(pr *pkgReader, relocs []pkgbits.RefTableEntry) []pkgbits.RefTableEntry { + res := make([]pkgbits.RefTableEntry, len(relocs)) for i, rent := range relocs { rent.Idx = l.relocIdx(pr, rent.Kind, rent.Idx) res[i] = rent |
