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