reloc.go 835 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2021 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package pkgbits
  5. // A RelocKind indicates a particular section within a unified IR export.
  6. type RelocKind int32
  7. // An Index represents a bitstream element index within a particular
  8. // section.
  9. type Index int32
  10. // A relocEnt (relocation entry) is an entry in an element's local
  11. // reference table.
  12. //
  13. // TODO(mdempsky): Rename this too.
  14. type RelocEnt struct {
  15. Kind RelocKind
  16. Idx Index
  17. }
  18. // Reserved indices within the meta relocation section.
  19. const (
  20. PublicRootIdx Index = 0
  21. PrivateRootIdx Index = 1
  22. )
  23. const (
  24. RelocString RelocKind = iota
  25. RelocMeta
  26. RelocPosBase
  27. RelocPkg
  28. RelocName
  29. RelocType
  30. RelocObj
  31. RelocObjExt
  32. RelocObjDict
  33. RelocBody
  34. numRelocs = iota
  35. )