2018-11-28 14:18:09 -08:00
|
|
|
namespace Ryujinx.HLE.Loaders.Elf
|
|
|
|
{
|
|
|
|
struct ElfSymbol
|
|
|
|
{
|
2018-12-04 16:52:39 -08:00
|
|
|
public string Name { get; private set; }
|
2018-11-28 14:18:09 -08:00
|
|
|
|
2018-12-04 16:52:39 -08:00
|
|
|
public ElfSymbolType Type { get; private set; }
|
|
|
|
public ElfSymbolBinding Binding { get; private set; }
|
|
|
|
public ElfSymbolVisibility Visibility { get; private set; }
|
2018-11-28 14:18:09 -08:00
|
|
|
|
|
|
|
public bool IsFuncOrObject =>
|
2018-12-06 03:16:24 -08:00
|
|
|
Type == ElfSymbolType.SttFunc ||
|
|
|
|
Type == ElfSymbolType.SttObject;
|
2018-11-28 14:18:09 -08:00
|
|
|
|
|
|
|
public bool IsGlobalOrWeak =>
|
2018-12-06 03:16:24 -08:00
|
|
|
Binding == ElfSymbolBinding.StbGlobal ||
|
|
|
|
Binding == ElfSymbolBinding.StbWeak;
|
2018-11-28 14:18:09 -08:00
|
|
|
|
2018-12-06 03:16:24 -08:00
|
|
|
public int ShIdx { get; private set; }
|
2020-01-12 03:06:26 -08:00
|
|
|
public ulong Value { get; private set; }
|
|
|
|
public ulong Size { get; private set; }
|
2018-11-28 14:18:09 -08:00
|
|
|
|
|
|
|
public ElfSymbol(
|
2018-12-06 03:16:24 -08:00
|
|
|
string name,
|
|
|
|
int info,
|
|
|
|
int other,
|
|
|
|
int shIdx,
|
2020-01-12 03:06:26 -08:00
|
|
|
ulong value,
|
|
|
|
ulong size)
|
2018-11-28 14:18:09 -08:00
|
|
|
{
|
2018-12-06 03:16:24 -08:00
|
|
|
Name = name;
|
|
|
|
Type = (ElfSymbolType)(info & 0xf);
|
|
|
|
Binding = (ElfSymbolBinding)(info >> 4);
|
|
|
|
Visibility = (ElfSymbolVisibility)other;
|
|
|
|
ShIdx = shIdx;
|
|
|
|
Value = value;
|
|
|
|
Size = size;
|
2018-11-28 14:18:09 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|