Port-arm archive

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

Re: thumb libc SIGILL from __libc_mutex_unlock (Re: thumb compilation)

If I flag getopt to compile with -mthumb-interwork only, I get this from
a statically linked /bin/cat:

Program received signal SIGILL, Illegal instruction.
0x00008d64 in open ()
(gdb) bt
#0  0x00008d64 in open ()
#1  0x00008648 in raw_args ()
#2  0x0001f7f8 in ?? ()
(gdb) info registers
r0             0x7ffffeeb       2147483371
r1             0x0      0
r2             0x0      0
r3             0x8d64   36196
r4             0x7ffffeeb       2147483371
r5             0x0      0
r6             0x7fffee28       2147479080
r7             0x2b6cc  177868
r8             0x30358  197464
r9             0x0      0
r10            0x8d8c   36236
r11            0x7fffee14       2147479060
r12            0x2b110  176400
sp             0x7fffed3c       2147478844
lr             0x8649   34377
pc             0x8d64   36196
fps            0x0      0
cpsr           0x40000010       1073741840
(gdb) disassemble 0x00008d64
Dump of assembler code for function open:
0x00008d64 <open+0>:    movwle  sp, #24325      ; 0x5f05
0x00008d68 <open+4>:    addlt   r11, r1, r0, lsl #10
0x00008d6c <open+8>:    ldc2    0, cr15, [r2, #-76]!
0x00008d70 <open+12>:   stclt   0, cr11, [r0, #-4]
0x00008d74 <open+16>:   undefined
End of assembler dump.

objdump shows again different instructions:

00008d64 <_sys_open>:
    8d64:       df05            swi     5
    8d66:       d305            bcc     8d74 <_sys_open+0x10>
    8d68:       b500            push    {lr}
    8d6a:       b081            sub     sp, #4
    8d6c:       fd32f013        bl      1c7d4 <__cerror>
    8d70:       b001            add     sp, #4
    8d72:       bd00            pop     {pc}
    8d74:       4770            bx      lr
    8d76:       46c0            nop                     (mov r8, r8)

swi or svc should work with thumb too.


Home | Main Index | Thread Index | Old Index