From d1652432319455945c71009495e269f14fae9a19 Mon Sep 17 00:00:00 2001 From: jakcron Date: Sat, 2 Jun 2018 20:13:29 +0800 Subject: [PATCH] [nx] Add defines for NSO/NRO dynamic symbols. --- lib/libnx/include/nx/dynamic_symbol.h | 56 +++++++++++++++++++++++++++ lib/libnx/nx.vcxproj | 1 + lib/libnx/nx.vcxproj.filters | 3 ++ 3 files changed, 60 insertions(+) create mode 100644 lib/libnx/include/nx/dynamic_symbol.h diff --git a/lib/libnx/include/nx/dynamic_symbol.h b/lib/libnx/include/nx/dynamic_symbol.h new file mode 100644 index 0000000..899c03c --- /dev/null +++ b/lib/libnx/include/nx/dynamic_symbol.h @@ -0,0 +1,56 @@ +#pragma once +#include + +namespace nx +{ + namespace dynsym + { + enum SpecialSectionIndex + { + SHN_UNDEF, + SHN_LORESERVE = 65280, + SHN_LOPROC = 65280, + SHN_HIPROC = 65311, + SHN_LOOS, + SHN_HIOS = 65343, + SHN_ABS = 65521, + SHN_COMMON, + SHN_HIRESERVE = 0xFFFF + }; + + enum SymbolType + { + STT_NOTYPE, + STT_OBJECT, + STT_FUNC, + STT_SECTION, + STT_FILE, + STT_LOOS = 10, + STT_HIOS = 12, + STT_LOPROC, + STT_HIPROC = 0xF + }; + } + +#pragma pack(push,1) + struct sDynSymbol32Bit + { + le_uint32_t name; + le_uint32_t value; + le_uint32_t size; + le_uint32_t info; + le_uint32_t other; + le_uint32_t special_section_index; + }; + + struct sDynSymbol64Bit + { + le_uint32_t name; + byte_t info; + byte_t other; + le_uint16_t special_section_index; + le_uint64_t value; + le_uint64_t size; + }; +#pragma pack(pop) +} \ No newline at end of file diff --git a/lib/libnx/nx.vcxproj b/lib/libnx/nx.vcxproj index 6c40e2a..a4db247 100644 --- a/lib/libnx/nx.vcxproj +++ b/lib/libnx/nx.vcxproj @@ -26,6 +26,7 @@ + diff --git a/lib/libnx/nx.vcxproj.filters b/lib/libnx/nx.vcxproj.filters index a2b3661..1692fb2 100644 --- a/lib/libnx/nx.vcxproj.filters +++ b/lib/libnx/nx.vcxproj.filters @@ -162,6 +162,9 @@ Header Files + + Header Files +