Skip to content

Commit

Permalink
Revert "[ARM JIT] Enable relative branches by default"
Browse files Browse the repository at this point in the history
This reverts commit f5d5780.
  • Loading branch information
Vogtinator committed May 4, 2017
1 parent 3160e05 commit 91f1f56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions core/os/os-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ void *os_alloc_executable(size_t size)
// Has to be in 32-bit space for the JIT
void *ptr = mmap((void*)0x30000000, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANON|MAP_32BIT, -1, 0);
#else
// Try to be as close to .text as possible to utilize relative branches
uintptr_t pref = (uintptr_t)(&os_alloc_executable);
pref += 0x800000;
pref &= ~(0xFFFF);

void *ptr = mmap((void*)pref, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANON, -1, 0);
void *ptr = mmap((void*)0x0, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANON, -1, 0);
#endif

if(ptr == MAP_FAILED)
Expand Down
2 changes: 1 addition & 1 deletion core/translate_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// Uncomment the following line to support relative jumps if possible,
// it doesn't work that often as the mmaped section is too far away.
#define REL_BRANCH
// #define REL_BRANCH

#include "asmcode.h"
#include "cpu.h"
Expand Down

0 comments on commit 91f1f56

Please sign in to comment.