Fix a crash that could happen due worng relocations. The address in the used bl is SINGNED. This mean for everything above 0x01FFFFFC we need to use the big jump.

This commit is contained in:
Maschell 2018-09-14 19:07:57 +02:00
parent b1d89c9d4d
commit 77288a2365

View File

@ -173,7 +173,7 @@ bool DynamicLinkingHelper::fillRelocations(std::vector<dyn_linking_relocation_en
DEBUG_FUNCTION_LINE("Resolving relocation to %s\n",functionEntry->functionName);
if(!curEntry->importEntry->isData && (uint32_t) functionEntry->address > 0x04000000) {
if(!curEntry->importEntry->isData && (uint32_t) functionEntry->address > 0x01FFFFC) {
ElfTools::elfLinkOne(curEntry->type, curEntry->offset, curEntry->addend, curEntry->destination, (uint32_t) functionEntry->big_jump);
} else {
ElfTools::elfLinkOne(curEntry->type, curEntry->offset, curEntry->addend, curEntry->destination, (uint32_t) functionEntry->address);