aboutsummaryrefslogtreecommitdiff
path: root/c67-link.c
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2016-12-05 20:40:59 +0000
committerThomas Preud'homme <robotux@celest.fr>2016-12-05 20:51:10 +0000
commit59391d5520534ef1fe3cc2e96fa567c870e2f533 (patch)
treeb1382b41c1a41310db148c9939f1792b621332d9 /c67-link.c
parent097cf3aa5ee370bab50d6d15cef9b0af55a1a3a2 (diff)
downloadtinycc-59391d5520534ef1fe3cc2e96fa567c870e2f533.tar.gz
tinycc-59391d5520534ef1fe3cc2e96fa567c870e2f533.tar.bz2
Fix relocs_info declaration in tcc.h
C standard specifies that array should be declared with a non null size or with * for standard array. Declaration of relocs_info in tcc.h was not respecting this rule. This commit add a R_NUM macro that maps to the R_<ARCH>_NUM macros and declare relocs_info using it. This commit also moves all linker-related macros from <arch>-gen.c files to <arch>-link.c ones.
Diffstat (limited to 'c67-link.c')
-rw-r--r--c67-link.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/c67-link.c b/c67-link.c
index d8b0f7e..960b34b 100644
--- a/c67-link.c
+++ b/c67-link.c
@@ -1,6 +1,25 @@
-#include "tcc.h"
+#ifdef TARGET_DEFS_ONLY
+
+#define EM_TCC_TARGET EM_C60
+
+/* relocation type for 32 bit data relocation */
+#define R_DATA_32 R_C60_32
+#define R_DATA_PTR R_C60_32
+#define R_JMP_SLOT R_C60_JMP_SLOT
+#define R_GLOB_DAT R_C60_GLOB_DAT
+#define R_COPY R_C60_COPY
+
+#define R_NUM R_C60_NUM
+
+#define ELF_START_ADDR 0x00000400
+#define ELF_PAGE_SIZE 0x1000
+
#define HAVE_SECTION_RELOC
+#else /* !TARGET_DEFS_ONLY */
+
+#include "tcc.h"
+
void relocate_init(Section *sr) {}
void relocate(TCCState *s1, ElfW_Rel *rel, int type, char *ptr, addr_t addr, addr_t val)
@@ -33,3 +52,5 @@ void relocate(TCCState *s1, ElfW_Rel *rel, int type, char *ptr, addr_t addr, add
break;
}
}
+
+#endif /* !TARGET_DEFS_ONLY */