aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorbellard <bellard>2003-10-04 21:24:46 +0000
committerbellard <bellard>2003-10-04 21:24:46 +0000
commitfeed3262c91df6e491e3f529192acdcc6a72f157 (patch)
treeb6ba3500659a02664977345d5cd5ea3a51cf941f /tccelf.c
parentbef8703f772d63ceff6ef36de97db550adeee754 (diff)
downloadtinycc-feed3262c91df6e491e3f529192acdcc6a72f157.tar.gz
tinycc-feed3262c91df6e491e3f529192acdcc6a72f157.tar.bz2
fixed libc linking when running in memory
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tccelf.c b/tccelf.c
index 599bc31..91a9a7e 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -849,9 +849,12 @@ static void tcc_add_runtime(TCCState *s1)
#endif
}
#endif
- /* add libc if not memory output */
- if (s1->output_type != TCC_OUTPUT_MEMORY && !s1->nostdlib) {
+ /* 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_file(s1, CONFIG_TCC_CRT_PREFIX "/crtn.o");
}
/* add various standard linker symbols */