mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-07 07:30:33 +00:00
win32 fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3965 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
3aba3d86f7
commit
a4d8670ffc
42
dyngen.c
42
dyngen.c
@ -1914,17 +1914,37 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
type = rel->r_type;
|
type = rel->r_type;
|
||||||
switch(type) {
|
if (is_label) {
|
||||||
case DIR32:
|
/* TCG uses elf relocation constants */
|
||||||
fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n",
|
#define R_386_32 1
|
||||||
reloc_offset, relname, addend);
|
#define R_386_PC32 2
|
||||||
break;
|
switch(type) {
|
||||||
case DISP32:
|
case DIR32:
|
||||||
fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %d) + %d -4;\n",
|
type = R_386_32;
|
||||||
reloc_offset, relname, reloc_offset, addend);
|
goto do_reloc;
|
||||||
break;
|
case DISP32:
|
||||||
default:
|
type = R_386_PC32;
|
||||||
error("unsupported i386 relocation (%d)", type);
|
addend -= 4;
|
||||||
|
do_reloc:
|
||||||
|
fprintf(outfile, " tcg_out_reloc(s, gen_code_ptr + %d, %d, %s, %d);\n",
|
||||||
|
reloc_offset, type, relname, addend);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
error("unsupported i386 relocation (%d)", type);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch(type) {
|
||||||
|
case DIR32:
|
||||||
|
fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s + %d;\n",
|
||||||
|
reloc_offset, relname, addend);
|
||||||
|
break;
|
||||||
|
case DISP32:
|
||||||
|
fprintf(outfile, " *(uint32_t *)(gen_code_ptr + %d) = %s - (long)(gen_code_ptr + %d) + %d -4;\n",
|
||||||
|
reloc_offset, relname, reloc_offset, addend);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
error("unsupported i386 relocation (%d)", type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#error unsupport object format
|
#error unsupport object format
|
||||||
|
Loading…
Reference in New Issue
Block a user