aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2009-12-19 22:08:37 +0100
committergrischka <grischka>2009-12-19 22:16:20 +0100
commit1308e8ebcfba43b4b96b7ef32f1a177b1168665d (patch)
treeeed594426e6d4d6f266be4cc0cfe0cde9627ad43 /x86_64-gen.c
parente81569bc70697d4380e7456e7938dec29c91af73 (diff)
downloadtinycc-1308e8ebcfba43b4b96b7ef32f1a177b1168665d.tar.gz
tinycc-1308e8ebcfba43b4b96b7ef32f1a177b1168665d.tar.bz2
integrate x86_64-asm.c into i386-asm.c
Also, disable 16bit support for now as it causes bugs in 32bit mode. #define I386_ASM_16 if you want it.
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 052bf87..9f05889 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -123,6 +123,12 @@ void o(unsigned int c)
}
}
+void gen_le16(int v)
+{
+ g(v);
+ g(v >> 8);
+}
+
void gen_le32(int c)
{
g(c);
@@ -192,7 +198,13 @@ static int oad(int c, int s)
return s;
}
-#if 0
+static void gen_addr32(int r, Sym *sym, int c)
+{
+ if (r & VT_SYM)
+ greloc(cur_text_section, sym, ind, R_X86_64_32);
+ gen_le32(c);
+}
+
/* output constant with relocation if 'r & VT_SYM' is true */
static void gen_addr64(int r, Sym *sym, int64_t c)
{
@@ -200,7 +212,6 @@ static void gen_addr64(int r, Sym *sym, int64_t c)
greloc(cur_text_section, sym, ind, R_X86_64_64);
gen_le64(c);
}
-#endif
/* output constant with relocation if 'r & VT_SYM' is true */
static void gen_addrpc32(int r, Sym *sym, int c)