Missing __init_array_start in dynamic lib
Posted: Thu Aug 30, 2007 1:18 pm
Anyone knows when __init_array_start gets a definition? When I check my newlib port, it shows that it is a weak(?) link:
When I check the application linked to newlib, the __init_array_start symbol is defined here.
So, is this how it's supposed to be, and newlib's __init_array_start symbol should be dynamically linked in runtime to the program's __init_array_start? Or I understood something wrong.
Another thing... I think my newlib doesn't get initialized... the _init function is just empty:
Is this releated to the __init_array_start symbol, so that when I link my program to the lib, the lib's initialization routines are put in the program's __init_array_start?
Code: Select all
$ nm /usr/local/cross/i386-pc-shmix/lib/libc.so | grep __init_array_start
w __init_array_start
Code: Select all
$ nm ../software/testlibc/testlibc.elf | grep __init_array_start
08001000 A __init_array_start
Another thing... I think my newlib doesn't get initialized... the _init function is just empty:
Code: Select all
$ gdb /usr/local/cross/i386-pc-shmix/lib/libc.so
(gdb) disas _init
Dump of assembler code for function _init:
0x00026588 <_init+0>: push %ebp
0x00026589 <_init+1>: mov %esp,%ebp
0x0002658b <_init+3>: leave
0x0002658c <_init+4>: ret
End of assembler dump.