/programs/develop/ktcc/trunk/source/libtcc.c |
---|
2279,6 → 2279,9 |
case TCC_OPTION_B: |
/* set tcc utilities path (mainly for tcc development) */ |
tcc_set_lib_path(s, optarg); |
#ifdef TCC_TARGET_MEOS |
tcc_split_path(s, (void ***)&s->crt_paths, &s->nb_crt_paths, CONFIG_TCC_CRTPREFIX); |
#endif |
break; |
case TCC_OPTION_l: |
args_parser_add_file(s, r, TCC_FILETYPE_BINARY); |
/programs/develop/ktcc/trunk/source/tccelf.c |
---|
18,6 → 18,7 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#include "libtcc.h" |
#include "tcc.h" |
/* Define this to get some debug output during relocation processing. */ |
1618,9 → 1619,9 |
ST_FUNC void tcc_add_runtime(TCCState *s1) |
{ |
tcc_add_pragma_libs(s1); |
/* add libc */ |
if (!s1->nostdlib) { |
#if !defined (TCC_TARGET_MEOS) |
tcc_add_library(s1, "c"); |
#ifdef CONFIG_USE_LIBGCC |
if (!s1->static_link) { |
1627,8 → 1628,12 |
tcc_add_file(s1, TCC_LIBGCC, TCC_FILETYPE_BINARY); |
} |
#endif |
#if !defined(TCC_TARGET_MEOS) |
tcc_add_support(s1, "libtcc1.a"); |
#else |
if (tcc_add_library_err(s1, "c") < 0 || |
tcc_add_library_err(s1, "tcc1") < 0) { |
exit(1); |
} |
#endif |
} |
1636,18 → 1641,14 |
libtcc1.a must be loaded before for __bound_init to be defined and |
crtn.o must be loaded after to not finalize _init too early. */ |
tcc_add_bcheck(s1); |
#if !defined (TCC_TARGET_MEOS) |
if (!s1->nostdlib) { |
/* add crt end if not memory output */ |
if (s1->output_type != TCC_OUTPUT_MEMORY) |
#if defined(TCC_TARGET_MEOS) |
; |
// tcc_add_crt(s1, "start.o"); |
#else |
tcc_add_crt(s1, "crtn.o"); |
} |
#endif |
} |
} |
/* add various standard linker symbols (must be done after the |
sections are filled (for example after allocating common |
/programs/develop/ktcc/trunk/source/tccmeos.c |
---|
19,10 → 19,6 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ |
#ifndef TCC_TARGET_KX |
int undef_sym_flag=0; |
#endif |
typedef struct { |
char magic[8]; |
int version; |
130,8 → 126,6 |
int sym_index = find_elf_sym(me->s1->dynsymtab_section, sym_name); |
Elf32_Sym* dyn_sym; |
if (sym_index == 0) { |
#else |
undef_sym_flag=1; |
#endif |
tcc_error_noabort("undefined symbol '%s'", sym_name); |
continue; |
302,13 → 296,9 |
#ifdef TCC_TARGET_KX |
kx_init(&me); |
#endif |
tcc_add_runtime(s1); |
relocate_common_syms(); |
assign_addresses(&me); |
#ifndef TCC_TARGET_KX |
if(undef_sym_flag){ |
tcc_error("Linker error!"); |
} |
#endif |
if (s1->do_debug) |
tcc_output_dbgme(filename, &me); |
317,6 → 307,10 |
me.header.params= tcc_find_symbol_me(&me,"__argv"); // <-- |
me.header.argv= tcc_find_symbol_me(&me,"__path"); // <-- |
if (!me.header.entry_point || !me.header.params || me.header.argv) { |
exit(1); |
} |
if((f=fopen(filename,"wb"))==NULL){ |
tcc_error("could not create '%s': %s", filename, strerror(errno)); |
} |