Shmuel Zeigerman wrote:
A simple patch against tcc-0.9.24 is proposed (attached).
A fixed patch is attached :)
--
Shmuel
diff -urNb tcc-0.9.24\tcc.c tcc\tcc.c
--- tcc-0.9.24\tcc.c Mon Mar 31 10:24:00 2008
+++ tcc\tcc.c Sun Apr 27 23:39:10 2008
@@ -11063,14 +11063,7 @@
} 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)
diff -urNb tcc-0.9.24\tccelf.c tcc\tccelf.c
--- tcc-0.9.24\tccelf.c Mon Mar 31 10:24:00 2008
+++ tcc\tccelf.c Sun Apr 27 23:40:08 2008
@@ -1132,7 +1132,7 @@
/* 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;
@@ -1773,6 +1773,20 @@
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;
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel