aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
authorgrischka <grischka>2009-07-18 22:05:27 +0200
committergrischka <grischka>2009-07-18 22:05:27 +0200
commit3ea4acb9b9151442da2fb6057906aff4c094bcef (patch)
tree0a4fe1e8904f20937df8fe2f62f9f874bf4674bc /libtcc.c
parent719ba918dd14f6c86e47e1af10f31895e814c80e (diff)
downloadtinycc-3ea4acb9b9151442da2fb6057906aff4c094bcef.tar.gz
tinycc-3ea4acb9b9151442da2fb6057906aff4c094bcef.tar.bz2
pe32+ target: add in various #define's
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libtcc.c b/libtcc.c
index 30cc552..8a6fa0c 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1689,6 +1689,7 @@ int tcc_relocate(TCCState *s1, void *ptr)
if (s1->nb_errors)
return -1;
+#ifndef TCC_TARGET_PE
#ifdef TCC_TARGET_X86_64
s1->runtime_plt_and_got_offset = 0;
s1->runtime_plt_and_got = (char *)(mem + offset);
@@ -1696,6 +1697,7 @@ int tcc_relocate(TCCState *s1, void *ptr)
XXX: calculate exact size for them? */
offset *= 2;
#endif
+#endif
if (0 == mem)
return offset + 15;
@@ -1722,10 +1724,12 @@ int tcc_relocate(TCCState *s1, void *ptr)
if (s->sh_flags & SHF_EXECINSTR)
set_pages_executable(ptr, length);
}
+#ifndef TCC_TARGET_PE
#ifdef TCC_TARGET_X86_64
set_pages_executable(s1->runtime_plt_and_got,
s1->runtime_plt_and_got_offset);
#endif
+#endif
return 0;
}
@@ -1859,6 +1863,9 @@ TCCState *tcc_new(void)
#endif
#ifdef TCC_TARGET_PE
tcc_define_symbol(s, "_WIN32", NULL);
+#ifdef TCC_TARGET_X86_64
+ tcc_define_symbol(s, "_WIN64", NULL);
+#endif
#else
tcc_define_symbol(s, "__unix__", NULL);
tcc_define_symbol(s, "__unix", NULL);