diff options
| author | bellard <bellard> | 2002-09-08 22:46:32 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2002-09-08 22:46:32 +0000 |
| commit | d8ef07df04443465600f94e8c5d769899a2e4d27 (patch) | |
| tree | a3a860c837938f683eab08a40344fb5407815de3 /tccelf.c | |
| parent | 10f5d44f43cd6e93a17fb00aa63c79bb13fc0a81 (diff) | |
| download | tinycc-d8ef07df04443465600f94e8c5d769899a2e4d27.tar.gz tinycc-d8ef07df04443465600f94e8c5d769899a2e4d27.tar.bz2 | |
added tcc_relocate() and tcc_get_symbol()
Diffstat (limited to 'tccelf.c')
| -rw-r--r-- | tccelf.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -154,7 +154,7 @@ static int find_elf_sym(Section *s, const char *name) } /* return elf symbol value or error */ -static unsigned long get_elf_sym_val(const char *name) +void *tcc_get_symbol(TCCState *s, const char *name) { int sym_index; Elf32_Sym *sym; @@ -163,7 +163,7 @@ static unsigned long get_elf_sym_val(const char *name) if (!sym_index) error("%s not defined", name); sym = &((Elf32_Sym *)symtab_section->data)[sym_index]; - return sym->st_value; + return (void *)sym->st_value; } /* add an elf symbol : check if it is already defined and patch @@ -1294,7 +1294,7 @@ int tcc_output_file(TCCState *s1, const char *filename) /* get entry point address */ if (file_type == TCC_OUTPUT_EXE) - ehdr.e_entry = get_elf_sym_val("_start"); + ehdr.e_entry = (unsigned long)tcc_get_symbol(s1, "_start"); else ehdr.e_entry = text_section->sh_addr; /* XXX: is it correct ? */ } |
