aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libtcc.c b/libtcc.c
index 40b845e..823078e 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -325,14 +325,10 @@ static inline int toup(int c)
#ifdef CONFIG_TCC_ASM
-#ifdef TCC_TARGET_I386
+#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
#include "i386-asm.c"
#endif
-#ifdef TCC_TARGET_X86_64
-#include "x86_64-asm.c"
-#endif
-
#include "tccasm.c"
#else
static void asm_instr(void)
@@ -854,10 +850,14 @@ static void put_extern_sym(Sym *sym, Section *section,
/* add a new relocation entry to symbol 'sym' in section 's' */
static void greloc(Section *s, Sym *sym, unsigned long offset, int type)
{
- if (!sym->c)
- put_extern_sym(sym, NULL, 0, 0);
+ int c = 0;
+ if (sym) {
+ if (0 == sym->c)
+ put_extern_sym(sym, NULL, 0, 0);
+ c = sym->c;
+ }
/* now we can add ELF relocation info */
- put_elf_reloc(symtab_section, s, offset, type, sym->c);
+ put_elf_reloc(symtab_section, s, offset, type, c);
}
static void strcat_vprintf(char *buf, int buf_size, const char *fmt, va_list ap)