changeset 289:4df05eda3e3f

[project @ 2003-10-04 21:24:46 by bellard] fixed libc linking when running in memory
author bellard
date Sat, 04 Oct 2003 21:24:46 +0000
parents e8abebbf04bd
children 5974fe4b1e28
files tccelf.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tccelf.c	Sat Oct 04 21:23:51 2003 +0000
+++ b/tccelf.c	Sat Oct 04 21:24:46 2003 +0000
@@ -849,9 +849,12 @@
 #endif
     }
 #endif
-    /* add libc if not memory output */
+    /* add libc */
+    if (!s1->nostdlib) {
+        tcc_add_library(s1, "c");
+    }
+    /* add crt end if not memory output */
     if (s1->output_type != TCC_OUTPUT_MEMORY && !s1->nostdlib) {
-        tcc_add_library(s1, "c");
         tcc_add_file(s1, CONFIG_TCC_CRT_PREFIX "/crtn.o");
     }
     /* add various standard linker symbols */