[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using __clone() system call on Etrax-LX with Linux 2.4.3


I am running linux 2.4.3 on an etrax-lx development board. My
application uses the __clone() system call, but I got a link error while
building. I am using the uC-libC library that comes with the development
environment. The libs I link against are libucc.a, libic.a, libgcc.a,
libucc.a in that order as defined by the gcc_cris script.

I found that the cris-compiler RPM distribution comes with a version of
glibc that has an entry point for __clone(). When I link against this
libc.a, my application links. But when executed on the board, it does
not seem to execute __clone() at all.

I then disassembled the libc.a and looked at the code of __clone. This
is what I get:

Disassembly of section .text:

00000000 <__clone>:
   0:   7fa2                    moveq -1,$r10
   2:   3f0d 0000 0000          jump 0 <__clone>
   8:   7a86                    clear.d $r10
   a:   5fbc 1101               movu.w 0x111,$r11
   e:   fce1 ee1f               push $r1
  12:   5f1c 7800               movu.w 0x78,$r1
  16:   3de9                    break 13
  18:   6e1e                    pop $r1
  1a:   efae 01f0 ffff          cmp.d 0xfffff001,$r10
  20:   0810                    bcs 2a <__clone+0x2a>
  22:   0f05                    nop
  24:   3f0d 0000 0000          jump 0 <__clone>
  2a:   7fb6                    ret
  2c:   0f05                    nop

I don't know much about assembly, but this does not look quite correct
to me. The second instruction is a jump 0.

Is there any other library that provides a proper entry for __clone()? I
guess I could just wait for pthreads to get finished :-).