From 96bd8f2b25f12e4859f8666fc0b33063d47dd730 Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 5 May 2008 22:39:43 +0000 Subject: enable pe-output from libtcc (Shmuel Zeigerman) --- tccelf.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tccelf.c') diff --git a/tccelf.c b/tccelf.c index a3c594d..62f8c33 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1132,7 +1132,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f, /* output an ELF file */ /* XXX: suppress unneeded sections */ -int tcc_output_file(TCCState *s1, const char *filename) +int elf_output_file(TCCState *s1, const char *filename) { Elf32_Ehdr ehdr; FILE *f; @@ -1788,6 +1788,20 @@ int tcc_output_file(TCCState *s1, const char *filename) return ret; } +int tcc_output_file(TCCState *s, const char *filename) +{ + int ret; +#ifdef TCC_TARGET_PE + if (s->output_type != TCC_OUTPUT_OBJ) { + ret = pe_output_file(s, filename); + } else +#endif + { + ret = elf_output_file(s, filename); + } + return ret; +} + static void *load_data(int fd, unsigned long file_offset, unsigned long size) { void *data; -- cgit v1.3.1