aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
authorgrischka <grischka>2017-05-13 08:59:06 +0200
committergrischka <grischka>2017-05-13 08:59:06 +0200
commit28435ec58c2ef9bb571cad5f8a1129aea3ecc204 (patch)
treea08b77f90c9c24972e0fccd6c223af73b5b240f6 /x86_64-gen.c
parent3a9d6b3655bd15e752e65a4f0f23f64f4ec56fe1 (diff)
downloadtinycc-28435ec58c2ef9bb571cad5f8a1129aea3ecc204.tar.gz
tinycc-28435ec58c2ef9bb571cad5f8a1129aea3ecc204.tar.bz2
configure: --config-musl/-uClibc switch & misc cleanups
- configure: - add --config-uClibc,-musl switch and suggest to use it if uClibc/musl is detected - make warning options magic clang compatible - simplify (use $confvars instead of individual options) - Revert "Remove some unused-parameter lint" 7443db0d5f841b81a55e918bf8c228dd20f9ddb2 rather use -Wno-unused-parameter (or just not -Wextra) - #ifdef functions that are unused on some targets - tccgen.c: use PTR_SIZE==8 instead of (X86_64 || ARM64) - tccpe.c: fix some warnings - integrate dummy arm-asm better
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 38c488d..584fd07 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -25,6 +25,7 @@
/* number of available registers */
#define NB_REGS 25
#define NB_ASM_REGS 16
+#define CONFIG_TCC_ASM
/* a register can belong to several classes. The classes must be
sorted from more general to more precise (see gv2() code which does
@@ -264,17 +265,15 @@ ST_FUNC void gen_addrpc32(int r, Sym *sym, long c)
/* output got address with relocation */
static void gen_gotpcrel(int r, Sym *sym, int c)
{
-#ifndef TCC_TARGET_PE
- greloca(cur_text_section, sym, ind, R_X86_64_GOTPCREL, -4);
-#else
+#ifdef TCC_TARGET_PE
tcc_error("internal error: no GOT on PE: %s %x %x | %02x %02x %02x\n",
get_tok_str(sym->v, NULL), c, r,
cur_text_section->data[ind-3],
cur_text_section->data[ind-2],
cur_text_section->data[ind-1]
);
- greloc(cur_text_section, sym, ind, R_X86_64_PC32);
#endif
+ greloca(cur_text_section, sym, ind, R_X86_64_GOTPCREL, -4);
gen_le32(0);
if (c) {
/* we use add c, %xxx for displacement */
@@ -1661,14 +1660,14 @@ void gfunc_epilog(void)
func_bound_offset, lbounds_section->data_offset);
saved_ind = ind;
ind = func_bound_ind;
- greloc(cur_text_section, sym_data, ind + 1, R_386_32);
+ greloca(cur_text_section, sym_data, ind + 1, R_X86_64_64, 0);
ind = ind + 5 + 3;
gen_static_call(TOK___bound_local_new);
ind = saved_ind;
/* generate bound check local freeing */
o(0x5250); /* save returned value, if any */
- greloc(cur_text_section, sym_data, ind + 1, R_386_32);
+ greloca(cur_text_section, sym_data, ind + 1, R_X86_64_64, 0);
oad(0xb8, 0); /* mov xxx, %rax */
o(0xc78948); /* mov %rax,%rdi # first arg in %rdi, this must be ptr */
gen_static_call(TOK___bound_local_delete);