summaryrefslogtreecommitdiff
path: root/dyngen.h
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-07-02 14:06:26 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-07-02 14:06:26 +0000
commit6d8aa3bfed71ef1a09290e9bcdf741e37e9f7a06 (patch)
tree9ccbcd86e34535c6fcc15a26f794d593dc80f3ac /dyngen.h
parent2657c6633280f6ed9b1b5e75a6c60f069b39f702 (diff)
downloadqemu-6d8aa3bfed71ef1a09290e9bcdf741e37e9f7a06.tar.gz
Remove unaligned accesses in ia64_apply_fixes().
Make sure that the static variables are not optimized away in GOTO_TB. (patch by Andreas Schwab) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3042 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'dyngen.h')
-rw-r--r--dyngen.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/dyngen.h b/dyngen.h
index 48e40192c5..86dd3d6199 100644
--- a/dyngen.h
+++ b/dyngen.h
@@ -392,7 +392,8 @@ static inline void ia64_apply_fixes (uint8_t **gen_code_pp,
0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* nop 0; brl IP */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0
};
- uint8_t *gen_code_ptr = *gen_code_pp, *plt_start, *got_start, *vp;
+ uint8_t *gen_code_ptr = *gen_code_pp, *plt_start, *got_start;
+ uint64_t *vp;
struct ia64_fixup *fixup;
unsigned int offset = 0;
struct fdesc {
@@ -429,12 +430,12 @@ static inline void ia64_apply_fixes (uint8_t **gen_code_pp,
/* First, create the GOT: */
for (fixup = ltoff_fixes; fixup; fixup = fixup->next) {
/* first check if we already have this value in the GOT: */
- for (vp = got_start; vp < gen_code_ptr; ++vp)
- if (*(uint64_t *) vp == fixup->value)
+ for (vp = (uint64_t *) got_start; vp < (uint64_t *) gen_code_ptr; ++vp)
+ if (*vp == fixup->value)
break;
- if (vp == gen_code_ptr) {
+ if (vp == (uint64_t *) gen_code_ptr) {
/* Nope, we need to put the value in the GOT: */
- *(uint64_t *) vp = fixup->value;
+ *vp = fixup->value;
gen_code_ptr += 8;
}
ia64_imm22(fixup->addr, (long) vp - gp);