From ca92bfc3c64128872793c167de3a58a78b9a1299 Mon Sep 17 00:00:00 2001 From: grischka Date: Thu, 15 Dec 2016 17:01:22 +0100 Subject: tccelf: some linker cleanup - generate and use SYM@PLT for plt addresses - get rid of patch_dynsym_undef hack (no idea what it did on FreeBSD) - use sym_attrs instead of symtab_to_dynsym - special case for function pointers into .so on i386 - libtcc_test: test tcc_add_symbol with data object - move target specicic code to *-link.c files - add R_XXX_RELATIVE (needed for PE) --- c67-link.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'c67-link.c') diff --git a/c67-link.c b/c67-link.c index f3220cb..ce45269 100644 --- a/c67-link.c +++ b/c67-link.c @@ -14,8 +14,8 @@ #define ELF_START_ADDR 0x00000400 #define ELF_PAGE_SIZE 0x1000 -#define HAVE_SECTION_RELOC #define PCRELATIVE_DLLPLT 0 +#define RELOCATE_DLLPLT 0 #else /* !TARGET_DEFS_ONLY */ @@ -68,6 +68,32 @@ int gotplt_entry_type (int reloc_type) return -1; } +ST_FUNC unsigned create_plt_entry(TCCState *s1, unsigned got_offset, struct sym_attr *attr) +{ + tcc_error("C67 got not implemented"); + return 0; +} + +/* relocate the PLT: compute addresses and offsets in the PLT now that final + address for PLT and GOT are known (see fill_program_header) */ +ST_FUNC void relocate_plt(TCCState *s1) +{ + uint8_t *p, *p_end; + + if (!s1->plt) + return; + + p = s1->plt->data; + p_end = p + s1->plt->data_offset; + + if (p < p_end) { + /* XXX: TODO */ + while (p < p_end) { + /* XXX: TODO */ + } + } +} + void relocate_init(Section *sr) {} void relocate(TCCState *s1, ElfW_Rel *rel, int type, char *ptr, addr_t addr, addr_t val) -- cgit v1.3.1