aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/Loaders/Elf
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE/Loaders/Elf')
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs4
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs133
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs36
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfSymbol32.cs14
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfSymbol64.cs14
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs6
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs14
-rw-r--r--src/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs10
8 files changed, 116 insertions, 115 deletions
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs
index f489e85a..4cc1a9fe 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs
@@ -8,8 +8,8 @@ namespace Ryujinx.HLE.Loaders.Elf
public ElfDynamic(ElfDynamicTag tag, long value)
{
- Tag = tag;
+ Tag = tag;
Value = value;
}
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs
index eb37d612..6505e17d 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs
@@ -3,73 +3,74 @@ using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.HLE.Loaders.Elf
{
[SuppressMessage("ReSharper", "InconsistentNaming")]
+ [SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
enum ElfDynamicTag
{
- DT_NULL = 0,
- DT_NEEDED = 1,
- DT_PLTRELSZ = 2,
- DT_PLTGOT = 3,
- DT_HASH = 4,
- DT_STRTAB = 5,
- DT_SYMTAB = 6,
- DT_RELA = 7,
- DT_RELASZ = 8,
- DT_RELAENT = 9,
- DT_STRSZ = 10,
- DT_SYMENT = 11,
- DT_INIT = 12,
- DT_FINI = 13,
- DT_SONAME = 14,
- DT_RPATH = 15,
- DT_SYMBOLIC = 16,
- DT_REL = 17,
- DT_RELSZ = 18,
- DT_RELENT = 19,
- DT_PLTREL = 20,
- DT_DEBUG = 21,
- DT_TEXTREL = 22,
- DT_JMPREL = 23,
- DT_BIND_NOW = 24,
- DT_INIT_ARRAY = 25,
- DT_FINI_ARRAY = 26,
- DT_INIT_ARRAYSZ = 27,
- DT_FINI_ARRAYSZ = 28,
- DT_RUNPATH = 29,
- DT_FLAGS = 30,
- DT_ENCODING = 32,
- DT_PREINIT_ARRAY = 32,
+ DT_NULL = 0,
+ DT_NEEDED = 1,
+ DT_PLTRELSZ = 2,
+ DT_PLTGOT = 3,
+ DT_HASH = 4,
+ DT_STRTAB = 5,
+ DT_SYMTAB = 6,
+ DT_RELA = 7,
+ DT_RELASZ = 8,
+ DT_RELAENT = 9,
+ DT_STRSZ = 10,
+ DT_SYMENT = 11,
+ DT_INIT = 12,
+ DT_FINI = 13,
+ DT_SONAME = 14,
+ DT_RPATH = 15,
+ DT_SYMBOLIC = 16,
+ DT_REL = 17,
+ DT_RELSZ = 18,
+ DT_RELENT = 19,
+ DT_PLTREL = 20,
+ DT_DEBUG = 21,
+ DT_TEXTREL = 22,
+ DT_JMPREL = 23,
+ DT_BIND_NOW = 24,
+ DT_INIT_ARRAY = 25,
+ DT_FINI_ARRAY = 26,
+ DT_INIT_ARRAYSZ = 27,
+ DT_FINI_ARRAYSZ = 28,
+ DT_RUNPATH = 29,
+ DT_FLAGS = 30,
+ DT_ENCODING = 32,
+ DT_PREINIT_ARRAY = 32,
DT_PREINIT_ARRAYSZ = 33,
- DT_GNU_PRELINKED = 0x6ffffdf5,
- DT_GNU_CONFLICTSZ = 0x6ffffdf6,
- DT_GNU_LIBLISTSZ = 0x6ffffdf7,
- DT_CHECKSUM = 0x6ffffdf8,
- DT_PLTPADSZ = 0x6ffffdf9,
- DT_MOVEENT = 0x6ffffdfa,
- DT_MOVESZ = 0x6ffffdfb,
- DT_FEATURE_1 = 0x6ffffdfc,
- DT_POSFLAG_1 = 0x6ffffdfd,
- DT_SYMINSZ = 0x6ffffdfe,
- DT_SYMINENT = 0x6ffffdff,
- DT_GNU_HASH = 0x6ffffef5,
- DT_TLSDESC_PLT = 0x6ffffef6,
- DT_TLSDESC_GOT = 0x6ffffef7,
- DT_GNU_CONFLICT = 0x6ffffef8,
- DT_GNU_LIBLIST = 0x6ffffef9,
- DT_CONFIG = 0x6ffffefa,
- DT_DEPAUDIT = 0x6ffffefb,
- DT_AUDIT = 0x6ffffefc,
- DT_PLTPAD = 0x6ffffefd,
- DT_MOVETAB = 0x6ffffefe,
- DT_SYMINFO = 0x6ffffeff,
- DT_VERSYM = 0x6ffffff0,
- DT_RELACOUNT = 0x6ffffff9,
- DT_RELCOUNT = 0x6ffffffa,
- DT_FLAGS_1 = 0x6ffffffb,
- DT_VERDEF = 0x6ffffffc,
- DT_VERDEFNUM = 0x6ffffffd,
- DT_VERNEED = 0x6ffffffe,
- DT_VERNEEDNUM = 0x6fffffff,
- DT_AUXILIARY = 0x7ffffffd,
- DT_FILTER = 0x7fffffff
+ DT_GNU_PRELINKED = 0x6ffffdf5,
+ DT_GNU_CONFLICTSZ = 0x6ffffdf6,
+ DT_GNU_LIBLISTSZ = 0x6ffffdf7,
+ DT_CHECKSUM = 0x6ffffdf8,
+ DT_PLTPADSZ = 0x6ffffdf9,
+ DT_MOVEENT = 0x6ffffdfa,
+ DT_MOVESZ = 0x6ffffdfb,
+ DT_FEATURE_1 = 0x6ffffdfc,
+ DT_POSFLAG_1 = 0x6ffffdfd,
+ DT_SYMINSZ = 0x6ffffdfe,
+ DT_SYMINENT = 0x6ffffdff,
+ DT_GNU_HASH = 0x6ffffef5,
+ DT_TLSDESC_PLT = 0x6ffffef6,
+ DT_TLSDESC_GOT = 0x6ffffef7,
+ DT_GNU_CONFLICT = 0x6ffffef8,
+ DT_GNU_LIBLIST = 0x6ffffef9,
+ DT_CONFIG = 0x6ffffefa,
+ DT_DEPAUDIT = 0x6ffffefb,
+ DT_AUDIT = 0x6ffffefc,
+ DT_PLTPAD = 0x6ffffefd,
+ DT_MOVETAB = 0x6ffffefe,
+ DT_SYMINFO = 0x6ffffeff,
+ DT_VERSYM = 0x6ffffff0,
+ DT_RELACOUNT = 0x6ffffff9,
+ DT_RELCOUNT = 0x6ffffffa,
+ DT_FLAGS_1 = 0x6ffffffb,
+ DT_VERDEF = 0x6ffffffc,
+ DT_VERDEFNUM = 0x6ffffffd,
+ DT_VERNEED = 0x6ffffffe,
+ DT_VERNEEDNUM = 0x6fffffff,
+ DT_AUXILIARY = 0x7ffffffd,
+ DT_FILTER = 0x7fffffff,
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs
index 1cfc0bdc..1ed61b2c 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs
@@ -4,32 +4,32 @@ namespace Ryujinx.HLE.Loaders.Elf
{
public string Name { get; private set; }
- public ElfSymbolType Type { get; private set; }
- public ElfSymbolBinding Binding { get; private set; }
+ public ElfSymbolType Type { get; private set; }
+ public ElfSymbolBinding Binding { get; private set; }
public ElfSymbolVisibility Visibility { get; private set; }
- public bool IsFuncOrObject => Type == ElfSymbolType.SttFunc || Type == ElfSymbolType.SttObject;
- public bool IsGlobalOrWeak => Binding == ElfSymbolBinding.StbGlobal || Binding == ElfSymbolBinding.StbWeak;
+ public readonly bool IsFuncOrObject => Type == ElfSymbolType.SttFunc || Type == ElfSymbolType.SttObject;
+ public readonly bool IsGlobalOrWeak => Binding == ElfSymbolBinding.StbGlobal || Binding == ElfSymbolBinding.StbWeak;
- public int ShIdx { get; private set; }
+ public int ShIdx { get; private set; }
public ulong Value { get; private set; }
- public ulong Size { get; private set; }
+ public ulong Size { get; private set; }
public ElfSymbol(
string name,
- int info,
- int other,
- int shIdx,
- ulong value,
- ulong size)
+ int info,
+ int other,
+ int shIdx,
+ ulong value,
+ ulong size)
{
- Name = name;
- Type = (ElfSymbolType)(info & 0xf);
- Binding = (ElfSymbolBinding)(info >> 4);
+ Name = name;
+ Type = (ElfSymbolType)(info & 0xf);
+ Binding = (ElfSymbolBinding)(info >> 4);
Visibility = (ElfSymbolVisibility)other;
- ShIdx = shIdx;
- Value = value;
- Size = size;
+ ShIdx = shIdx;
+ Value = value;
+ Size = size;
}
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol32.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol32.cs
index 2f84796b..945b0c8b 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol32.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol32.cs
@@ -2,13 +2,13 @@
{
struct ElfSymbol32
{
-#pragma warning disable CS0649
- public uint NameOffset;
- public uint ValueAddress;
- public uint Size;
- public byte Info;
- public byte Other;
+#pragma warning disable CS0649 // Field is never assigned to
+ public uint NameOffset;
+ public uint ValueAddress;
+ public uint Size;
+ public byte Info;
+ public byte Other;
public ushort SectionIndex;
#pragma warning restore CS0649
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol64.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol64.cs
index 665e65b0..3a73ca4e 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol64.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbol64.cs
@@ -2,13 +2,13 @@
{
struct ElfSymbol64
{
-#pragma warning disable CS0649
- public uint NameOffset;
- public byte Info;
- public byte Other;
+#pragma warning disable CS0649 // Field is never assigned to
+ public uint NameOffset;
+ public byte Info;
+ public byte Other;
public ushort SectionIndex;
- public ulong ValueAddress;
- public ulong Size;
+ public ulong ValueAddress;
+ public ulong Size;
#pragma warning restore CS0649
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs
index 92274fde..cf504ae2 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs
@@ -2,8 +2,8 @@ namespace Ryujinx.HLE.Loaders.Elf
{
enum ElfSymbolBinding
{
- StbLocal = 0,
+ StbLocal = 0,
StbGlobal = 1,
- StbWeak = 2
+ StbWeak = 2,
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs
index 4110d4c3..9dc41436 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs
@@ -2,12 +2,12 @@ namespace Ryujinx.HLE.Loaders.Elf
{
enum ElfSymbolType
{
- SttNoType = 0,
- SttObject = 1,
- SttFunc = 2,
+ SttNoType = 0,
+ SttObject = 1,
+ SttFunc = 2,
SttSection = 3,
- SttFile = 4,
- SttCommon = 5,
- SttTls = 6
+ SttFile = 4,
+ SttCommon = 5,
+ SttTls = 6,
}
-} \ No newline at end of file
+}
diff --git a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs
index f026fca8..6305ab1c 100644
--- a/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs
+++ b/src/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs
@@ -2,9 +2,9 @@ namespace Ryujinx.HLE.Loaders.Elf
{
enum ElfSymbolVisibility
{
- StvDefault = 0,
- StvInternal = 1,
- StvHidden = 2,
- StvProtected = 3
+ StvDefault = 0,
+ StvInternal = 1,
+ StvHidden = 2,
+ StvProtected = 3,
}
-} \ No newline at end of file
+}