From d8ef07df04443465600f94e8c5d769899a2e4d27 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 8 Sep 2002 22:46:32 +0000 Subject: added tcc_relocate() and tcc_get_symbol() --- tccelf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tccelf.c') diff --git a/tccelf.c b/tccelf.c index 0704ab0..05a9c30 100644 --- a/tccelf.c +++ b/tccelf.c @@ -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 ? */ } -- cgit v1.3.1