Mercurial > hg > qcc
comparison tccelf.c @ 564:d89a6822b7e0
Use library search path for crt?.o, and for ld script libraries with no path.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 11 Mar 2008 23:45:07 -0500 |
parents | 646f1f0972b6 |
children | c42c2145d359 |
comparison
equal
deleted
inserted
replaced
563:8e32c8615b39 | 564:d89a6822b7e0 |
---|---|
1012 if (!tccg_nostdlib) { | 1012 if (!tccg_nostdlib) { |
1013 tcc_add_library(s1, "c"); | 1013 tcc_add_library(s1, "c"); |
1014 tcc_add_library(s1, "tinyccrt-" TINYCC_TARGET); | 1014 tcc_add_library(s1, "tinyccrt-" TINYCC_TARGET); |
1015 // add crt end if not memory output | 1015 // add crt end if not memory output |
1016 if (tccg_output_type != TCC_OUTPUT_MEMORY) | 1016 if (tccg_output_type != TCC_OUTPUT_MEMORY) |
1017 tcc_add_file(s1, CC_CRTDIR "/crtn.o"); | 1017 tcc_add_dll(s1, "crtn.o", AFF_PRINT_ERROR); |
1018 } | 1018 } |
1019 } | 1019 } |
1020 | 1020 |
1021 /* add various standard linker symbols (must be done after the | 1021 /* add various standard linker symbols (must be done after the |
1022 sections are filled (for example after allocating common | 1022 sections are filled (for example after allocating common |
2332 ret = ld_add_file_list(s1, 1); | 2332 ret = ld_add_file_list(s1, 1); |
2333 if (ret) | 2333 if (ret) |
2334 return ret; | 2334 return ret; |
2335 } else { | 2335 } else { |
2336 /* TODO: Implement AS_NEEDED support. Ignore it for now */ | 2336 /* TODO: Implement AS_NEEDED support. Ignore it for now */ |
2337 if (!as_needed) | 2337 if (!as_needed) { |
2338 tcc_add_file(s1, filename); | 2338 if (*filename=='/') tcc_add_file(s1, filename); |
2339 else tcc_add_dll(s1, filename, AFF_PRINT_ERROR); | |
2340 } | |
2339 } | 2341 } |
2340 t = ld_next(s1, filename, sizeof(filename)); | 2342 t = ld_next(s1, filename, sizeof(filename)); |
2341 if (t == ',') { | 2343 if (t == ',') { |
2342 t = ld_next(s1, filename, sizeof(filename)); | 2344 t = ld_next(s1, filename, sizeof(filename)); |
2343 } | 2345 } |