Add CustomRPXLoader to every OSFatal

This commit is contained in:
Maschell 2023-06-16 17:12:35 +02:00
parent 3e42af85fa
commit a0f49dab93
3 changed files with 8 additions and 8 deletions

View File

@ -11,9 +11,9 @@
#undef IMPORT_BEGIN
#undef IMPORT_END
#define IMPORT(name) \
do { \
if (OSDynLoad_FindExport(handle, 0, #name, &addr_##name) < 0) OSFatal("Function " #name " is NULL"); \
#define IMPORT(name) \
do { \
if (OSDynLoad_FindExport(handle, 0, #name, &addr_##name) < 0) OSFatal("CustomRPXLoader: Function " #name " is NULL"); \
} while (0)
#define IMPORT_BEGIN(lib) OSDynLoad_Acquire(#lib ".rpl", &handle)
/* #define IMPORT_END() OSDynLoad_Release(handle) */

View File

@ -119,7 +119,7 @@ uint32_t do_start(int argc, char **argv) {
std::vector<RelocationData> relocData = moduleData->getRelocationDataList();
if (!doRelocation(relocData, gModuleData->trampolines, DYN_LINK_TRAMPOLIN_LIST_LENGTH)) {
DEBUG_FUNCTION_LINE("relocations failed");
OSFatal("Relocations failed");
OSFatal("CustomRPXLoader: Relocations failed");
}
if (moduleData->getBSSAddr() != 0) {
DEBUG_FUNCTION_LINE("memset .bss %08X (%d)", moduleData->getBSSAddr(), moduleData->getBSSSize());

View File

@ -203,7 +203,7 @@ std::vector<RelocationData> ModuleDataFactory::getImportRelocationData(const elf
Elf64_Addr sym_value;
if (!rel.get_entry(j, offset, symbol, type, addend)) {
OSFatal("Failed to get relocation");
OSFatal("CustomRPXLoader: get_entry failed");
return {};
}
symbol_section_accessor symbols(reader, reader.sections[(Elf_Half) psec->get_link()]);
@ -217,7 +217,7 @@ std::vector<RelocationData> ModuleDataFactory::getImportRelocationData(const elf
if (!symbols.get_symbol(symbol, sym_name, sym_value, size,
bind, symbolType, sym_section_index, other)) {
OSFatal("Failed to get relocation");
OSFatal("CustomRPXLoader: get_symbol failed");
return {};
}
@ -261,7 +261,7 @@ bool ModuleDataFactory::linkSection(const elfio &reader, uint32_t section_index,
Elf64_Addr sym_value;
if (!rel.get_entry(j, offset, symbol, type, addend)) {
OSFatal("Failed to get relocation");
OSFatal("CustomRPXLoader: get_entry failed");
return {};
}
symbol_section_accessor symbols(reader, reader.sections[(Elf_Half) psec->get_link()]);
@ -275,7 +275,7 @@ bool ModuleDataFactory::linkSection(const elfio &reader, uint32_t section_index,
if (!symbols.get_symbol(symbol, sym_name, sym_value, size,
bind, symbolType, sym_section_index, other)) {
OSFatal("Failed to get relocation");
OSFatal("CustomRPXLoader: get_symbol failed");
return {};
}