ElfSymbol.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace Ryujinx.HLE.Loaders.Elf
  2. {
  3. struct ElfSymbol
  4. {
  5. public string Name { get; private set; }
  6. public ElfSymbolType Type { get; private set; }
  7. public ElfSymbolBinding Binding { get; private set; }
  8. public ElfSymbolVisibility Visibility { get; private set; }
  9. public bool IsFuncOrObject =>
  10. Type == ElfSymbolType.STT_FUNC ||
  11. Type == ElfSymbolType.STT_OBJECT;
  12. public bool IsGlobalOrWeak =>
  13. Binding == ElfSymbolBinding.STB_GLOBAL ||
  14. Binding == ElfSymbolBinding.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 ElfSymbol(
  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 = (ElfSymbolType)(Info & 0xf);
  28. this.Binding = (ElfSymbolBinding)(Info >> 4);
  29. this.Visibility = (ElfSymbolVisibility)Other;
  30. this.SHIdx = SHIdx;
  31. this.Value = Value;
  32. this.Size = Size;
  33. }
  34. }
  35. }