ElfSym.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace Ryujinx.HLE.Loaders
  2. {
  3. struct ElfSym
  4. {
  5. public string Name { get; private set; }
  6. public ElfSymType Type { get; private set; }
  7. public ElfSymBinding Binding { get; private set; }
  8. public ElfSymVisibility Visibility { get; private set; }
  9. public bool IsFuncOrObject =>
  10. Type == ElfSymType.STT_FUNC ||
  11. Type == ElfSymType.STT_OBJECT;
  12. public bool IsGlobalOrWeak =>
  13. Binding == ElfSymBinding.STB_GLOBAL ||
  14. Binding == ElfSymBinding.STB_WEAK;
  15. public int SHIdx { get; private set; }
  16. public long Value { get; private set; }
  17. public long Size { get; private set; }
  18. public ElfSym(
  19. string Name,
  20. int Info,
  21. int Other,
  22. int SHIdx,
  23. long Value,
  24. long Size)
  25. {
  26. this.Name = Name;
  27. this.Type = (ElfSymType)(Info & 0xf);
  28. this.Binding = (ElfSymBinding)(Info >> 4);
  29. this.Visibility = (ElfSymVisibility)Other;
  30. this.SHIdx = SHIdx;
  31. this.Value = Value;
  32. this.Size = Size;
  33. }
  34. }
  35. }