1 --- qemu/dyngen.c.x 2005-05-16 10:30:43.000000000 +0100
2 +++ qemu/dyngen.c 2005-05-16 10:32:41.000000000 +0100
3 @@ -1996,6 +1996,9 @@ void gen_code(const char *name, host_ulo
5 int exit_addrs[MAX_EXITS];
8 + uint8_t *blr_addr = NULL;
11 /* Compute exact size excluding prologue and epilogue instructions.
12 * Increment start_offset to skip epilogue instructions, then compute
13 @@ -2018,9 +2021,23 @@ void gen_code(const char *name, host_ulo
14 p = (void *)(p_end - 4);
16 error("empty code for %s", name);
17 - if (get32((uint32_t *)p) != 0x4e800020)
18 - error("blr expected at the end of %s", name);
19 - copy_size = p - p_start;
20 + if (get32((uint32_t *)p) == 0x4e800020) {
21 + copy_size = p - p_start; /* blr at end */
23 + /* Find the blr and note its address so that we
24 + can emit code to rewrite it to a branch. */
28 + if (get32((uint32_t *)p) == 0x4e800020) {
30 + copy_size = p_end - p_start;
33 + } while (p > p_start);
35 + error("blr expected in the end of %s", name);
38 #elif defined(HOST_S390)
40 @@ -2633,6 +2650,9 @@ void gen_code(const char *name, host_ulo
42 #error unsupport object format
45 + fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = 0x48000000 | %d;\n",
46 + blr_addr - p_start, p_end - blr_addr);
48 #elif defined(HOST_S390)