]> Git Repo - qemu.git/blobdiff - dyngen.c
Cirrus VGA emulation
[qemu.git] / dyngen.c
index a817d62c9310ff497764fd81a325712c5742dc45..ff441caec0f83bb59d664521c8f94fc2a6385aba 100644 (file)
--- a/dyngen.c
+++ b/dyngen.c
@@ -30,7 +30,9 @@
 
 #include "config-host.h"
 
-#if defined(_WIN32)
+/* NOTE: we test CONFIG_WIN32 instead of _WIN32 to enabled cross
+   compilation */
+#if defined(CONFIG_WIN32)
 #define CONFIG_FORMAT_COFF
 #else
 #define CONFIG_FORMAT_ELF
@@ -1213,6 +1215,19 @@ void gen_code(const char *name, host_ulong offset, host_ulong size,
                         error("unsupported i386 relocation (%d)", type);
                     }
 #elif defined(CONFIG_FORMAT_COFF)
+                    {
+                        char *temp_name;
+                        int j;
+                        EXE_SYM *sym;
+                        temp_name = get_sym_name(symtab + *(uint32_t *)(rel->r_reloc->r_symndx));
+                        if (!strcmp(temp_name, ".data")) {
+                            for (j = 0, sym = symtab; j < nb_syms; j++, sym++) {
+                                if (strstart(sym->st_name, sym_name, NULL)) {
+                                    addend -= sym->st_value;
+                                }
+                            }
+                        }
+                    }
                     type = rel->r_type;
                     switch(type) {
                     case DIR32:
This page took 0.018625 seconds and 4 git commands to generate.