aboutsummaryrefslogtreecommitdiff
path: root/src/internal/pkgbits
diff options
context:
space:
mode:
authorMark Freeman <mark@golang.org>2025-05-19 16:06:42 -0400
committerGopher Robot <gobot@golang.org>2025-05-20 12:55:36 -0700
commitfa42585dadb8d70191820549435820cb70691cf6 (patch)
tree4ef28dcd50c108e7d37d841537703aa5470821bf /src/internal/pkgbits
parent96d2211c61189f056fa3c7c8d8abb351596c0f2c (diff)
downloadgo-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/internal/pkgbits')
-rw-r--r--src/internal/pkgbits/decoder.go12
-rw-r--r--src/internal/pkgbits/encoder.go8
-rw-r--r--src/internal/pkgbits/reloc.go8
3 files changed, 14 insertions, 14 deletions
diff --git a/src/internal/pkgbits/decoder.go b/src/internal/pkgbits/decoder.go
index 9ff6f5c76c..bbda6e9285 100644
--- a/src/internal/pkgbits/decoder.go
+++ b/src/internal/pkgbits/decoder.go
@@ -54,7 +54,7 @@ type PkgDecoder struct {
// (or 0, if K==0) and end at elemEndsEnds[K].
elemEndsEnds [numRelocs]uint32
- scratchRelocEnt []RelocEnt
+ scratchRelocEnt []RefTableEntry
}
// PkgPath returns the package path for the package
@@ -196,10 +196,10 @@ func (pr *PkgDecoder) NewDecoderRaw(k SectionKind, idx RelIndex) Decoder {
r.Data.Reset(pr.DataIdx(k, idx))
r.Sync(SyncRelocs)
- r.Relocs = make([]RelocEnt, r.Len())
+ r.Relocs = make([]RefTableEntry, r.Len())
for i := range r.Relocs {
r.Sync(SyncReloc)
- r.Relocs[i] = RelocEnt{SectionKind(r.Len()), RelIndex(r.Len())}
+ r.Relocs[i] = RefTableEntry{SectionKind(r.Len()), RelIndex(r.Len())}
}
return r
@@ -219,11 +219,11 @@ func (pr *PkgDecoder) TempDecoderRaw(k SectionKind, idx RelIndex) Decoder {
r.Relocs = pr.scratchRelocEnt[:l]
pr.scratchRelocEnt = nil
} else {
- r.Relocs = make([]RelocEnt, l)
+ r.Relocs = make([]RefTableEntry, l)
}
for i := range r.Relocs {
r.Sync(SyncReloc)
- r.Relocs[i] = RelocEnt{SectionKind(r.Len()), RelIndex(r.Len())}
+ r.Relocs[i] = RefTableEntry{SectionKind(r.Len()), RelIndex(r.Len())}
}
return r
@@ -234,7 +234,7 @@ func (pr *PkgDecoder) TempDecoderRaw(k SectionKind, idx RelIndex) Decoder {
type Decoder struct {
common *PkgDecoder
- Relocs []RelocEnt
+ Relocs []RefTableEntry
Data strings.Reader
k SectionKind
diff --git a/src/internal/pkgbits/encoder.go b/src/internal/pkgbits/encoder.go
index 5c51642e3c..3d1223bb63 100644
--- a/src/internal/pkgbits/encoder.go
+++ b/src/internal/pkgbits/encoder.go
@@ -147,8 +147,8 @@ func (pw *PkgEncoder) NewEncoderRaw(k SectionKind) *Encoder {
type Encoder struct {
p *PkgEncoder
- Relocs []RelocEnt
- RelocMap map[RelocEnt]uint32
+ Relocs []RefTableEntry
+ RelocMap map[RefTableEntry]uint32
Data bytes.Buffer // accumulated element bitstream data
encodingRelocHeader bool
@@ -211,13 +211,13 @@ func (w *Encoder) rawVarint(x int64) {
}
func (w *Encoder) rawReloc(k SectionKind, idx RelIndex) int {
- e := RelocEnt{k, idx}
+ e := RefTableEntry{k, idx}
if w.RelocMap != nil {
if i, ok := w.RelocMap[e]; ok {
return int(i)
}
} else {
- w.RelocMap = make(map[RelocEnt]uint32)
+ w.RelocMap = make(map[RefTableEntry]uint32)
}
i := len(w.Relocs)
diff --git a/src/internal/pkgbits/reloc.go b/src/internal/pkgbits/reloc.go
index d3b897757f..d132f4e995 100644
--- a/src/internal/pkgbits/reloc.go
+++ b/src/internal/pkgbits/reloc.go
@@ -32,10 +32,10 @@ type Index int32
// references from Index to RelIndex.
type RelIndex = Index
-// A RelocEnt, or relocation entry, is an entry in an element's reference
-// table. All elements are preceded by a reference table which provides
-// locations for all dereferences that the element may use.
-type RelocEnt struct {
+// A RefTableEntry is an entry in an element's reference table. All
+// elements are preceded by a reference table which provides locations
+// for referenced elements.
+type RefTableEntry struct {
Kind SectionKind
Idx RelIndex
}