From 77288a2365398f0e8b738ceaaaa7deec6e1b62a5 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 14 Sep 2018 19:07:57 +0200 Subject: [PATCH] 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. --- loader/src/plugin/DynamicLinkingHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/plugin/DynamicLinkingHelper.cpp b/loader/src/plugin/DynamicLinkingHelper.cpp index d764a03..207e13c 100644 --- a/loader/src/plugin/DynamicLinkingHelper.cpp +++ b/loader/src/plugin/DynamicLinkingHelper.cpp @@ -173,7 +173,7 @@ bool DynamicLinkingHelper::fillRelocations(std::vectorfunctionName); - 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);