2018-11-28 17:18:09 -05:00
|
|
|
namespace Ryujinx.HLE.Loaders.Elf
|
|
|
|
{
|
|
|
|
struct ElfSymbol
|
|
|
|
{
|
2018-12-04 19:52:39 -05:00
|
|
|
public string Name { get; private set; }
|
2018-11-28 17:18:09 -05:00
|
|
|
|
2018-12-04 19:52:39 -05:00
|
|
|
public ElfSymbolType Type { get; private set; }
|
|
|
|
public ElfSymbolBinding Binding { get; private set; }
|
|
|
|
public ElfSymbolVisibility Visibility { get; private set; }
|
2018-11-28 17:18:09 -05:00
|
|
|
|
|
|
|
public bool IsFuncOrObject =>
|
2018-12-04 19:52:39 -05:00
|
|
|
Type == ElfSymbolType.STT_FUNC ||
|
|
|
|
Type == ElfSymbolType.STT_OBJECT;
|
2018-11-28 17:18:09 -05:00
|
|
|
|
|
|
|
public bool IsGlobalOrWeak =>
|
2018-12-04 19:52:39 -05:00
|
|
|
Binding == ElfSymbolBinding.STB_GLOBAL ||
|
|
|
|
Binding == ElfSymbolBinding.STB_WEAK;
|
2018-11-28 17:18:09 -05:00
|
|
|
|
2018-12-04 19:52:39 -05:00
|
|
|
public int SHIdx { get; private set; }
|
|
|
|
public long Value { get; private set; }
|
|
|
|
public long Size { get; private set; }
|
2018-11-28 17:18:09 -05:00
|
|
|
|
|
|
|
public ElfSymbol(
|
2018-12-04 19:52:39 -05:00
|
|
|
string Name,
|
|
|
|
int Info,
|
|
|
|
int Other,
|
|
|
|
int SHIdx,
|
|
|
|
long Value,
|
|
|
|
long Size)
|
2018-11-28 17:18:09 -05:00
|
|
|
{
|
2018-12-04 19:52:39 -05: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;
|
2018-11-28 17:18:09 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|