Unified · Split
| @@ -11094,14 +11094,7 @@ int main(int argc, char **argv) · 11093 unmodified lines | ||
| 11094 | 11094 | } else if (s->output_type == TCC_OUTPUT_MEMORY) { |
| 11095 | 11095 | ret = tcc_run(s, argc - optind, argv + optind); |
| 11096 | 11096 | } else |
| 11097 | −#ifdef TCC_TARGET_PE | |
| 11098 | − if (s->output_type != TCC_OUTPUT_OBJ) { | |
| 11099 | − ret = pe_output_file(s, outfile); | |
| 11100 | − } else | |
| 11101 | −#endif | |
| 11102 | − { | |
| 11103 | 11097 | ret = tcc_output_file(s, outfile) ? 1 : 0; |
| 11104 | − } | |
| 11105 | 11098 | the_end: |
| 11106 | 11099 | /* XXX: cannot do it with bound checking because of the malloc hooks */ |
| 11107 | 11100 | if (!do_bounds_check) |
| @@ -1132,7 +1132,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f, · 1131 unmodified lines | ||
| 1132 | 1132 | |
| 1133 | 1133 | /* output an ELF file */ |
| 1134 | 1134 | /* XXX: suppress unneeded sections */ |
| 1135 | −int tcc_output_file(TCCState *s1, const char *filename) | |
| 1135 | +int elf_output_file(TCCState *s1, const char *filename) | |
| 1136 | 1136 | { |
| 1137 | 1137 | Elf32_Ehdr ehdr; |
| 1138 | 1138 | FILE *f; |
| @@ -1788,6 +1788,20 @@ int tcc_output_file(TCCState *s1, const char *filename) · 649 unmodified lines | ||
| 1788 | 1788 | return ret; |
| 1789 | 1789 | } |
| 1790 | 1790 | |
| 1791 | +int tcc_output_file(TCCState *s, const char *filename) | |
| 1792 | +{ | |
| 1793 | + int ret; | |
| 1794 | +#ifdef TCC_TARGET_PE | |
| 1795 | + if (s->output_type != TCC_OUTPUT_OBJ) { | |
| 1796 | + ret = pe_output_file(s, filename); | |
| 1797 | + } else | |
| 1798 | +#endif | |
| 1799 | + { | |
| 1800 | + ret = elf_output_file(s, filename); | |
| 1801 | + } | |
| 1802 | + return ret; | |
| 1803 | +} | |
| 1804 | + | |
| 1791 | 1805 | static void *load_data(int fd, unsigned long file_offset, unsigned long size) |
| 1792 | 1806 | { |
| 1793 | 1807 | void *data; |