diff --git a/src/Core/PS4/Linker.cpp b/src/Core/PS4/Linker.cpp index 95f877d4..b25e8c4a 100644 --- a/src/Core/PS4/Linker.cpp +++ b/src/Core/PS4/Linker.cpp @@ -246,6 +246,29 @@ void Linker::LoadDynamicInfo(Module* m) LOG_WARN_IF(debug_loader, "DT_SCE_SYMENT is NOT 0x18 should check!"); } break; + case DT_DEBUG: + m->dynamic_info->debug = dyn->d_un.d_val; + break; + case DT_TEXTREL: + m->dynamic_info->textrel = dyn->d_un.d_val; + break; + case DT_FLAGS: + m->dynamic_info->flags = dyn->d_un.d_val; + if (m->dynamic_info->flags != 0x04) //this value should always be DF_TEXTREL (0x04) + { + LOG_WARN_IF(debug_loader, "DT_FLAGS is NOT 0x04 should check!"); + } + break; + case DT_NEEDED://Offset of the library string in the string table to be linked in. + if (m->dynamic_info->str_table != nullptr)//in theory this should already be filled from about just make a test case + { + m->dynamic_info->needed.push_back(m->dynamic_info->str_table + dyn->d_un.d_val); + } + else + { + LOG_ERROR_IF(debug_loader, "DT_NEEDED str table is not loaded should check!"); + } + break; default: LOG_INFO_IF(debug_loader, "unsupported dynamic tag ..........: {:#018x}\n", dyn->d_tag); } diff --git a/src/Core/PS4/Linker.h b/src/Core/PS4/Linker.h index 09abe4b4..76aa8aea 100644 --- a/src/Core/PS4/Linker.h +++ b/src/Core/PS4/Linker.h @@ -45,6 +45,13 @@ struct DynamicModuleInfo elf_relocation* relocation_table = nullptr; u64 relocation_table_size = 0; u64 relocation_table_entries_size = 0; + + u64 debug = 0; + u64 textrel = 0; + u64 flags = 0; + + std::vector needed; + }; class Linker diff --git a/src/Loader/Elf.h b/src/Loader/Elf.h index 558c9748..97a92cf8 100644 --- a/src/Loader/Elf.h +++ b/src/Loader/Elf.h @@ -325,13 +325,17 @@ struct elf_program_id_header }; constexpr s64 DT_NULL = 0; +constexpr s64 DT_NEEDED = 0x00000001; constexpr s64 DT_RELA = 0x00000007; constexpr s64 DT_INIT = 0x0000000c; constexpr s64 DT_FINI = 0x0000000d; +constexpr s64 DT_DEBUG = 0x00000015; +constexpr s64 DT_TEXTREL = 0x00000016; constexpr s64 DT_INIT_ARRAY = 0x00000019; constexpr s64 DT_FINI_ARRAY = 0x0000001a; constexpr s64 DT_INIT_ARRAYSZ = 0x0000001b; constexpr s64 DT_FINI_ARRAYSZ = 0x0000001c; +constexpr s64 DT_FLAGS = 0x0000001e; constexpr s64 DT_PREINIT_ARRAY = 0x00000020; constexpr s64 DT_PREINIT_ARRAYSZ = 0x00000021; constexpr s64 DT_SCE_HASH = 0x61000025;