aboutsummaryrefslogtreecommitdiff
path: root/c67-link.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-12-15 17:01:22 +0100
committergrischka <grischka>2016-12-15 17:01:22 +0100
commitca92bfc3c64128872793c167de3a58a78b9a1299 (patch)
treed8fe09de7934dc0c23aef2417ce2bb9d589512f3 /c67-link.c
parentfe6453f8f08b5c21a339b3169a837772a9864d62 (diff)
downloadtinycc-ca92bfc3c64128872793c167de3a58a78b9a1299.tar.gz
tinycc-ca92bfc3c64128872793c167de3a58a78b9a1299.tar.bz2
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)
Diffstat (limited to 'c67-link.c')
-rw-r--r--c67-link.c28
1 files changed, 27 insertions, 1 deletions
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)