diff options
Diffstat (limited to 'src/cmd/compile/internal/noder/reloc.go')
-rw-r--r-- | src/cmd/compile/internal/noder/reloc.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/reloc.go b/src/cmd/compile/internal/noder/reloc.go new file mode 100644 index 0000000..669a618 --- /dev/null +++ b/src/cmd/compile/internal/noder/reloc.go @@ -0,0 +1,42 @@ +// UNREVIEWED + +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package noder + +// A reloc indicates a particular section within a unified IR export. +// +// TODO(mdempsky): Rename to "section" or something similar? +type reloc int + +// A relocEnt (relocation entry) is an entry in an atom's local +// reference table. +// +// TODO(mdempsky): Rename this too. +type relocEnt struct { + kind reloc + idx int +} + +// Reserved indices within the meta relocation section. +const ( + publicRootIdx = 0 + privateRootIdx = 1 +) + +const ( + relocString reloc = iota + relocMeta + relocPosBase + relocPkg + relocName + relocType + relocObj + relocObjExt + relocObjDict + relocBody + + numRelocs = iota +) |