Ryujinx/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs

40 lines
1.2 KiB
C#
Raw Normal View History

namespace Ryujinx.HLE.Loaders.Elf
{
struct ElfSymbol
{
public string Name { get; private set; }
public ElfSymbolType Type { get; private set; }
public ElfSymbolBinding Binding { get; private set; }
public ElfSymbolVisibility Visibility { get; private set; }
public bool IsFuncOrObject =>
2018-12-01 21:01:59 +01:00
Type == ElfSymbolType.SttFunc ||
Type == ElfSymbolType.SttObject;
public bool IsGlobalOrWeak =>
2018-12-01 21:01:59 +01:00
Binding == ElfSymbolBinding.StbGlobal ||
Binding == ElfSymbolBinding.StbWeak;
2018-12-01 21:01:59 +01:00
public int ShIdx { get; private set; }
public long Value { get; private set; }
public long Size { get; private set; }
public ElfSymbol(
2018-12-01 21:01:59 +01:00
string name,
int info,
int other,
int shIdx,
long value,
long size)
{
2018-12-01 21:01:59 +01:00
this.Name = name;
this.Type = (ElfSymbolType)(info & 0xf);
this.Binding = (ElfSymbolBinding)(info >> 4);
this.Visibility = (ElfSymbolVisibility)other;
this.ShIdx = shIdx;
this.Value = value;
this.Size = size;
}
}
}