RelocEntry.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace ARMeilleure.CodeGen.Linking
  2. {
  3. /// <summary>
  4. /// Represents a relocation.
  5. /// </summary>
  6. readonly struct RelocEntry
  7. {
  8. public const int Stride = 13; // Bytes.
  9. /// <summary>
  10. /// Gets the position of the relocation.
  11. /// </summary>
  12. public int Position { get; }
  13. /// <summary>
  14. /// Gets the <see cref="Symbol"/> of the relocation.
  15. /// </summary>
  16. public Symbol Symbol { get; }
  17. /// <summary>
  18. /// Initializes a new instance of the <see cref="RelocEntry"/> struct with the specified position and
  19. /// <see cref="Symbol"/>.
  20. /// </summary>
  21. /// <param name="position">Position of relocation</param>
  22. /// <param name="symbol">Symbol of relocation</param>
  23. public RelocEntry(int position, Symbol symbol)
  24. {
  25. Position = position;
  26. Symbol = symbol;
  27. }
  28. /// <inheritdoc/>
  29. public override string ToString()
  30. {
  31. return $"({nameof(Position)} = {Position}, {nameof(Symbol)} = {Symbol})";
  32. }
  33. }
  34. }