Commit d03d860b151d382e3a158e8e27838729cfcda075
1 parent
815a6742
Link ARM prologue closer to code segment to avoid a build failure
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4867 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
14 additions
and
1 deletions
arm.ld
exec.c
| ... | ... | @@ -89,7 +89,19 @@ int nb_tbs; |
| 89 | 89 | /* any access to the tbs or the page table must use this lock */ |
| 90 | 90 | spinlock_t tb_lock = SPIN_LOCK_UNLOCKED; |
| 91 | 91 | |
| 92 | -uint8_t code_gen_prologue[1024] __attribute__((aligned (32))); | |
| 92 | +#if defined(__arm__) | |
| 93 | +/* The prologue must be reachable with a direct jump. ARM has a | |
| 94 | + limited branch range (possibly also PPC and SPARC?) so place it in a | |
| 95 | + section close to code segment. */ | |
| 96 | +#define code_gen_section \ | |
| 97 | + __attribute__((__section__(".gen_code"))) \ | |
| 98 | + __attribute__((aligned (32))) | |
| 99 | +#else | |
| 100 | +#define code_gen_section \ | |
| 101 | + __attribute__((aligned (32))) | |
| 102 | +#endif | |
| 103 | + | |
| 104 | +uint8_t code_gen_prologue[1024] code_gen_section; | |
| 93 | 105 | uint8_t *code_gen_buffer; |
| 94 | 106 | unsigned long code_gen_buffer_size; |
| 95 | 107 | /* threshold to flush the translated code buffer */ | ... | ... |