aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorbellard <bellard>2004-10-04 21:57:35 +0000
committerbellard <bellard>2004-10-04 21:57:35 +0000
commit79c72b241998ee9ae533ae31a78913c4c50ca43e (patch)
treef2c8a602821cf2883886718b345c96374d72c374 /tccelf.c
parentdf36de6507e735faee3448687263a5c877d5f074 (diff)
downloadtinycc-79c72b241998ee9ae533ae31a78913c4c50ca43e.tar.gz
tinycc-79c72b241998ee9ae533ae31a78913c4c50ca43e.tar.bz2
initial TMS320C67xx support (TK)
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tccelf.c b/tccelf.c
index e31b412..e599867 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -548,6 +548,14 @@ static void relocate_section(TCCState *s1, Section *s)
fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",
type,addr,(unsigned int )ptr,val);
break;
+#elif defined(TCC_TARGET_C67)
+ case R_C60_32:
+ *(int *)ptr += val;
+ break;
+ default:
+ fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",
+ type,addr,(unsigned int )ptr,val);
+ break;
#else
#error unsupported processor
#endif
@@ -754,6 +762,8 @@ static void put_got_entry(TCCState *s1,
if (s1->output_type == TCC_OUTPUT_EXE)
offset = plt->data_offset - 16;
}
+#elif defined(TCC_TARGET_C67)
+ error("C67 got not implemented");
#else
#error unsupported CPU
#endif
@@ -828,6 +838,25 @@ static void build_got_entries(TCCState *s1)
sym_index);
}
break;
+#elif defined(TCC_TARGET_C67)
+ case R_C60_GOT32:
+ case R_C60_GOTOFF:
+ case R_C60_GOTPC:
+ case R_C60_PLT32:
+ if (!s1->got)
+ build_got(s1);
+ if (type == R_C60_GOT32 || type == R_C60_PLT32) {
+ sym_index = ELF32_R_SYM(rel->r_info);
+ sym = &((Elf32_Sym *)symtab_section->data)[sym_index];
+ /* look at the symbol got offset. If none, then add one */
+ if (type == R_C60_GOT32)
+ reloc_type = R_C60_GLOB_DAT;
+ else
+ reloc_type = R_C60_JMP_SLOT;
+ put_got_entry(s1, reloc_type, sym->st_size, sym->st_info,
+ sym_index);
+ }
+ break;
#else
#error unsupported CPU
#endif
@@ -1415,6 +1444,8 @@ int tcc_output_file(TCCState *s1, const char *filename)
put32(p + 12, x + get32(p + 12) + s1->plt->data - p);
p += 16;
}
+#elif defined(TCC_TARGET_C67)
+ /* XXX: TODO */
#else
#error unsupported CPU
#endif