[mips-gnu-discuss] CodeSourcery uclibc toolchain for mips_linux on timesys image doesn't run
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mips-gnu-discuss] CodeSourcery uclibc toolchain for mips_linux on timesys image doesn't run



Hi All,

I am trying to compile and run a very simple “hello world” program with
CodeSourcery uclibc toolchain for mips_linux:

*mips-linux-gnu-gcc test.c -o s_test*



I am trying to run it on my target machine that has Timesys linux (also
uclibc), for some reason I am getting this error:

*./s_test*

*-sh: ./s_test: not found*



The same test runs fine when compiled with Timesys uclibc toolchain:

*mipsisa32r2-timesys-linux-uclibc-gcc test.c -o t_test*



I even reduced the test to minimal code, but still got the same result, here
is the minimal test code

*int main(int argc, char **argv)*

*{*

* return 0;*

*}*



It looks like the linux can’t find the “main” entry point or something…



I tried to run strace to get some more info, here is what I got:

*strace ./s_test*

*execve("./s_test", ["./s_test"], [/* 15 vars */]) = -1 ENOENT (No such file
or directory)*

*write(2, "strace: exec: No such file or dir"..., 40strace: exec: No such
file or directory) = 40*

*exit(1)*                                 *= ?*



when I do strace for the test compiled with Timesys toolchain I get (first
few lines):

*strace ./t_test*

*execve("./t_test", ["./t_test"], [/* 15 vars */]) = 0*

*old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2aaad000*

*stat("/etc/ld.so.cache", 0x7f8709c0)    = -1 ENOENT (No such file or
directory)*

*open("/lib/libgcc_s.so.1", O_RDONLY)    = 3*

*….*



I run “nm” on both files and I attach the result here.

It looks like the not working Codesourcery test tries to run

*__libc_start_main*

While the working test runs

*__uClibc_main.c*



 Regards,

Alexander Rahlis,
0040017c r _DYNAMIC
00410730 D _GLOBAL_OFFSET_TABLE_
004006f4 R _IO_stdin_used
         w _Jv_RegisterClasses
00400420 t _PROCEDURE_LINKAGE_TABLE_
00410700 d __CTOR_END__
004106fc d __CTOR_LIST__
00410708 D __DTOR_END__
00410704 d __DTOR_LIST__
004006f8 r __FRAME_END__
0041070c d __JCR_END__
0041070c d __JCR_LIST__
00410720 D __RLD_MAP
0041074c A __bss_start
00410710 D __data_start
00400660 t __do_global_ctors_aux
004004b0 t __do_global_dtors_aux
00410748 G __dso_handle
         w __gmon_start__
004106fc d __init_array_end
004106fc d __init_array_start
004005b0 T __libc_csu_fini
004005b8 T __libc_csu_init
         U __libc_start_main@@GLIBC_2.0
00400460 T __start
0041074c A _edata
00410760 A _end
0041074c A _fbss
00410710 D _fdata
004006c0 T _fini
00400460 T _ftext
00418720 A _gp
         U _gp_disp
004003b0 T _init
00410750 b completed.5776
00410710 V data_start
00410754 b dtor_idx.5778
0040054c t frame_dummy
004004a8 t hlt
00400580 T main
00400160 r _DYNAMIC
00410840 A _GLOBAL_OFFSET_TABLE_
         w _Jv_RegisterClasses
00410804 d __CTOR_END__
00410800 d __CTOR_LIST__
0041080c D __DTOR_END__
00410808 d __DTOR_LIST__
004007fc r __EH_FRAME_BEGIN__
004007fc r __FRAME_END__
00410810 d __JCR_END__
00410810 d __JCR_LIST__
00410830 D __RLD_MAP
00410874 A __bss_start
00410820 D __data_start
         w __deregister_frame_info@@GLIBC_2.0
00400740 t __do_global_ctors_aux
004005f0 t __do_global_dtors_aux
00410870 G __dso_handle
         U __gnu_local_gp
         w __register_frame_info@@GLIBC_2.0
00400590 T __start
         U __uClibc_main
00410874 A _edata
004108a0 A _end
00410874 A _fbss
00410820 D _fdata
004007b0 T _fini
00400590 T _ftext
00418830 A _gp
         U _gp_disp
00400518 T _init
00410880 b completed.5209
00410820 V data_start
00410884 b dtor_idx.5211
004006a4 t frame_dummy
004005e0 t hlt
00400710 T main
00410888 b object.5235