From ee2108d07d1f16700e97b3f876a213ae6949bf0e Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 10 Dec 2016 17:11:00 +0000 Subject: [PATCH] Add missing relocation info for C67 target Fill in relocs_info table for C67 and fix R_C60_NUM value to really be greater than all relocation values known to TCC. --- c67-link.c | 12 +++++++++++- elf.h | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/c67-link.c b/c67-link.c index 0bc08d6..1eed3b6 100644 --- a/c67-link.c +++ b/c67-link.c @@ -21,7 +21,17 @@ #include "tcc.h" -ST_DATA struct reloc_info relocs_info[R_NUM]; +ST_DATA struct reloc_info relocs_info[R_NUM] = { + INIT_RELOC_INFO (R_C60_32, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_C60LO16, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_C60HI16, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_C60_GOTOFF, 0, BUILD_GOT_ONLY, 0) + INIT_RELOC_INFO (R_C60_GOTPC, 0, BUILD_GOT_ONLY, 0) + INIT_RELOC_INFO (R_C60_GOT32, 0, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_C60_PLT32, 1, ALWAYS_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_C60_GLOB_DAT, 0, NO_GOTPLT_ENTRY, 0) + INIT_RELOC_INFO (R_C60_JMP_SLOT, 1, NO_GOTPLT_ENTRY, 0) +}; void relocate_init(Section *sr) {} diff --git a/elf.h b/elf.h index 3d0976b..d761747 100644 --- a/elf.h +++ b/elf.h @@ -2549,11 +2549,11 @@ typedef Elf32_Addr Elf32_Conflict; #define R_C60_RELATIVE 8 /* Adjust by program base */ #define R_C60_GOTOFF 9 /* 32 bit offset to GOT */ #define R_C60_GOTPC 10 /* 32 bit PC relative offset to GOT */ -/* Keep this the last entry. */ -#define R_C60_NUM 11 -#define R_C60HI16 0x55 /* high 16 bit MVKH embedded */ #define R_C60LO16 0x54 /* low 16 bit MVKL embedded */ +#define R_C60HI16 0x55 /* high 16 bit MVKH embedded */ +/* Keep this the last entry. */ +#define R_C60_NUM 0x56 /* IA-64 specific declarations. */