History

enable pe-output from libtcc (Shmuel Zeigerman)

grischka committed 18 years ago

Commit 96bd8f21 parent f2698682 files · +15 −8Browse files

Unified · Split

2 files
  1. tcc.c +0 −7
  2. tccelf.c +15 −1
tcc.c+0−7
@@ -11094,14 +11094,7 @@ int main(int argc, char **argv) · 11093 unmodified lines
1109411094 } else if (s->output_type == TCC_OUTPUT_MEMORY) {
1109511095 ret = tcc_run(s, argc - optind, argv + optind);
1109611096 } 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− {
1110311097 ret = tcc_output_file(s, outfile) ? 1 : 0;
11104− }
1110511098 the_end:
1110611099 /* XXX: cannot do it with bound checking because of the malloc hooks */
1110711100 if (!do_bounds_check)
tccelf.c+15−1
@@ -1132,7 +1132,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f, · 1131 unmodified lines
11321132
11331133 /* output an ELF file */
11341134 /* XXX: suppress unneeded sections */
1135−int tcc_output_file(TCCState *s1, const char *filename)
1135+int elf_output_file(TCCState *s1, const char *filename)
11361136 {
11371137 Elf32_Ehdr ehdr;
11381138 FILE *f;
@@ -1788,6 +1788,20 @@ int tcc_output_file(TCCState *s1, const char *filename) · 649 unmodified lines
17881788 return ret;
17891789 }
17901790
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+
17911805 static void *load_data(int fd, unsigned long file_offset, unsigned long size)
17921806 {
17931807 void *data;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t