[uClibc] Trouble w/ Latest uClibc on m68k

Ken Treis ken at miriamtech.com
Fri Dec 12 17:12:14 UTC 2003


This was originally sent to the uClinux-dev mailing list, but that was 
probably the wrong forum for the question.

I'm trying to upgrade a uClinux system from uClibc 0.9.19 to 0.9.23 to 
take advantage of the reported thread-handling fixes that took place
somewhere between those two versions.

But every program that I link against 0.9.23 dies before it even gets to
main() with SIGILL. Using gdbserver, I've tracked this down to the point
where uClibc calls my main(). The trace looks something like this:

0x263848 in _start ()
...
0x26390c in __uClibc_main ()
...
0x263894 in __uClibc_start_main ()
...
0x263870 in __uClibc_init ()
...
0x2638ba in __uClibc_start_main ()
...
0x2638fc in __uClibc_start_main ()
0x1c in ?? ()
Program received signal SIGILL, Illegal instruction.
0x1c in ?? ()

0x1c is the offset of my main() function, according to objdump
   0000001c g     F .text  00000014 main
but it most certainly is not the actual address in RAM. So, knowing very
little about this, I have to presume that some sort of stack/frame
initialization is not being done correctly for the m68k architecture.

When compiling my program, I'm using -m5307 and -msep-data:
   m68k-elf-gcc -m5307 -DCONFIG_COLDFIRE -Os -g -fomit-frame-pointer
   -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED
   -I/home/kdt/fopis/uClinux-dist/lib/uClibc/include
   -I/home/kdt/fopis/uClinux-dist/lib/libm -I/home/kdt/fopis/uClinux-dist
   -fno-builtin -msep-data
   -I/home/kdt/fopis/uClinux-dist/linux-2.4.x/include -Wall -Wl,-elf2flt
   -o hello hello.o -L/home/kdt/fopis/uClinux-dist/lib/uClibc/.
   -L/home/kdt/fopis/uClinux-dist/lib/uClibc/lib
   -L/home/kdt/fopis/uClinux-dist/lib/libm
   -L/home/kdt/fopis/uClinux-dist/lib/libnet
   -L/home/kdt/fopis/uClinux-dist/lib/libdes
   -L/home/kdt/fopis/uClinux-dist/lib/libpcap
   -L/home/kdt/fopis/uClinux-dist/lib/libpthread
   -L/home/kdt/fopis/uClinux-dist/lib/zlib
   -L/home/kdt/fopis/uClinux-dist/lib/libssl -lc

I'm not using the PIC setting when building uClibc, since my app is
statically linked.

I haven't tried any versions of uClibc between 0.9.19 and 0.9.23, but
would be willing to do so if it'd be helpful in fixing this problem.

-- 
Ken Treis
Miriam Technologies, Inc.




More information about the uClibc mailing list