diff options
| author | grischka <grischka> | 2008-05-05 22:39:43 +0000 |
|---|---|---|
| committer | grischka <grischka> | 2008-05-05 22:39:43 +0000 |
| commit | 96bd8f2b25f12e4859f8666fc0b33063d47dd730 (patch) | |
| tree | 2b2f1075173ae2d87d57b1a0b84d5e9b269eeda4 | |
| parent | f2698687fba62800a1edd8da7067c6b3425769b9 (diff) | |
| download | tinycc-96bd8f2b25f12e4859f8666fc0b33063d47dd730.tar.gz tinycc-96bd8f2b25f12e4859f8666fc0b33063d47dd730.tar.bz2 | |
enable pe-output from libtcc (Shmuel Zeigerman)
| -rw-r--r-- | tcc.c | 7 | ||||
| -rw-r--r-- | tccelf.c | 16 |
2 files changed, 15 insertions, 8 deletions
@@ -11094,14 +11094,7 @@ int main(int argc, char **argv) } else if (s->output_type == TCC_OUTPUT_MEMORY) { ret = tcc_run(s, argc - optind, argv + optind); } else -#ifdef TCC_TARGET_PE - if (s->output_type != TCC_OUTPUT_OBJ) { - ret = pe_output_file(s, outfile); - } else -#endif - { ret = tcc_output_file(s, outfile) ? 1 : 0; - } the_end: /* XXX: cannot do it with bound checking because of the malloc hooks */ if (!do_bounds_check) @@ -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; |
