On Sat, Oct 11, 2008 at 9:50 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: > > Your startup code has to run the initialization routines. Basically, > when using ELF, it has to call _init before calling main. > > On GNU/Linux, the startup code, written in assembler, will call > __libc_start_main, and pass it the address of __libc_csu_init. The > latter function will call _init. This is all part of glibc. > > Ian > I am not using glibc. I am using newlib. Is the initialization the same for newlib? I have tried looking at some of the examples from newlib (the other crt0.s files) but they all seem to have init defined "somehow" when I don't. When I get to linking any programs it cannot find the _init function anywhere. I read somewhere that crti.o and crtn.o were the objects that defined the proper functions to get the init and fini sections to work, but I cannot get them to be compiled. In the libc.a library (generated by my newlib config) it has the symbols _init and _fini, but they are undefined globals. __libc_init_array and __libc_fini_array are defined globals. I suppose I could eat myself and try to port glibc. Sorry, I didn't send this the right way at first. I am still rather new to mailing lists.