Formatting

This commit is contained in:
Maschell 2021-09-23 18:30:08 +02:00
parent ba389535a9
commit 57163d6103
8 changed files with 18 additions and 11 deletions

View File

@ -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;
}

View File

@ -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);
};

View File

@ -16,6 +16,7 @@
****************************************************************************/
#pragma once
#include <cstdint>
typedef enum RelocationTrampolinStatus{

View File

@ -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) {

View File

@ -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);
};

View File

@ -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());
}