mirror of
https://github.com/wiiu-env/CustomRPXLoader.git
synced 2024-11-22 09:59:17 +01:00
Formatting
This commit is contained in:
parent
ba389535a9
commit
57163d6103
@ -22,7 +22,8 @@
|
||||
#include "ElfUtils.h"
|
||||
|
||||
// See https://github.com/decaf-emu/decaf-emu/blob/43366a34e7b55ab9d19b2444aeb0ccd46ac77dea/src/libdecaf/src/cafe/loader/cafe_loader_reloc.cpp#L144
|
||||
bool ElfUtils::elfLinkOne(char type, size_t offset, int32_t addend, uint32_t destination, uint32_t symbol_addr, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length, RelocationType reloc_type) {
|
||||
bool ElfUtils::elfLinkOne(char type, size_t offset, int32_t addend, uint32_t destination, uint32_t symbol_addr, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length,
|
||||
RelocationType reloc_type) {
|
||||
if (type == R_PPC_NONE) {
|
||||
return true;
|
||||
}
|
||||
|
@ -59,5 +59,6 @@ extern "C" {
|
||||
class ElfUtils {
|
||||
|
||||
public:
|
||||
static bool elfLinkOne(char type, size_t offset, int32_t addend, uint32_t destination, uint32_t symbol_addr, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length, RelocationType reloc_type);
|
||||
static bool elfLinkOne(char type, size_t offset, int32_t addend, uint32_t destination, uint32_t symbol_addr, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length,
|
||||
RelocationType reloc_type);
|
||||
};
|
||||
|
@ -16,6 +16,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
typedef enum RelocationTrampolinStatus{
|
||||
|
@ -25,7 +25,8 @@
|
||||
|
||||
using namespace ELFIO;
|
||||
|
||||
std::optional<ModuleData> ModuleDataFactory::load(const std::string &path, uint32_t destination_address, uint32_t maximum_size, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length) {
|
||||
std::optional<ModuleData>
|
||||
ModuleDataFactory::load(const std::string &path, uint32_t destination_address, uint32_t maximum_size, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length) {
|
||||
elfio reader;
|
||||
ModuleData moduleData;
|
||||
|
||||
@ -202,7 +203,8 @@ std::vector<RelocationData> ModuleDataFactory::getImportRelocationData(const elf
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ModuleDataFactory::linkSection(const elfio &reader, uint32_t section_index, uint32_t destination, uint32_t base_text, uint32_t base_data, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length) {
|
||||
bool ModuleDataFactory::linkSection(const elfio &reader, uint32_t section_index, uint32_t destination, uint32_t base_text, uint32_t base_data, relocation_trampolin_entry_t *trampolin_data,
|
||||
uint32_t trampolin_data_length) {
|
||||
uint32_t sec_num = reader.sections.size();
|
||||
|
||||
for (uint32_t i = 0; i < sec_num; ++i) {
|
||||
|
@ -28,7 +28,8 @@ class ModuleDataFactory {
|
||||
public:
|
||||
static std::optional<ModuleData> load(const std::string &path, uint32_t destination_address, uint32_t maximum_size, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length);
|
||||
|
||||
static bool linkSection(const ELFIO::elfio &reader, uint32_t section_index, uint32_t destination, uint32_t base_text, uint32_t base_data, relocation_trampolin_entry_t *trampolin_data, uint32_t trampolin_data_length);
|
||||
static bool linkSection(const ELFIO::elfio &reader, uint32_t section_index, uint32_t destination, uint32_t base_text, uint32_t base_data, relocation_trampolin_entry_t *trampolin_data,
|
||||
uint32_t trampolin_data_length);
|
||||
|
||||
static std::vector<RelocationData> getImportRelocationData(const ELFIO::elfio &reader, uint8_t **destinations);
|
||||
};
|
||||
|
@ -19,5 +19,6 @@
|
||||
#include "utils/StringTools.h"
|
||||
|
||||
std::string RelocationData::toString() const {
|
||||
return StringTools::strfmt("%s destination: %08X offset: %08X type: %02X addend: %d rplName: %s isData: %d \n", name.c_str(), destination, offset, type, addend, rplInfo.getName().c_str(), rplInfo.isData());
|
||||
return StringTools::strfmt("%s destination: %08X offset: %08X type: %02X addend: %d rplName: %s isData: %d \n", name.c_str(), destination, offset, type, addend, rplInfo.getName().c_str(),
|
||||
rplInfo.isData());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user