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)



On Fri, May 23, 2008 at 12:01:22PM +0100, Chris Gilbert wrote:
> Unless I'm missing something (which is likely :), you've not included the
> instruction that's causing the problem.

Good point, thanks!

gbd shows:

Program received signal SIGILL, Illegal instruction.
0x00008de8 in getopt ()
(gdb) info registers
r0             0x2      2
r1             0x7fffee24       2147479076
r2             0x1f710  128784
r3             0x0      0
r4             0x8db4   36276
r5             0x7fffee24       2147479076
r6             0x1f710  128784
r7             0x2      2
r8             0x0      0
r9             0x0      0
r10            0x2af94  176020
r11            0x7fffee14       2147479060
r12            0x7fffed74       2147478900
sp             0x7fffedc0       2147478976
lr             0x8bbd   35773
pc             0x8de8   36328
                 ^^^^
fps            0x0      0
cpsr           0x10     16
(gdb) bt
#0  0x00008de8 in getopt ()
          ^^^^
#1  0x00008bbc in main ()
(gdb) disassemble 0x00008de8
Dump of assembler code for function getopt:
0x00008db4 <getopt+0>:  undefined
0x00008db8 <getopt+4>:  strmib  r4, [r5], -lr, asr #12
0x00008dbc <getopt+8>:  strmi   r11, [r9], r0, ror #9
0x00008dc0 <getopt+12>: stmvsda r11, {r1, r2, r4, r6, r8, r11, lr}
0x00008dc4 <getopt+16>: ldrmi   r4, [r0], r2, lsl #13
0x00008dc8 <getopt+20>: teqle   r1, r0, lsl #22
0x00008dcc <getopt+24>: stmvsda r3!, {r2, r4, r6, r10, r11, lr}
0x00008dd0 <getopt+28>: bcs     0x26e40
0x00008dd4 <getopt+32>: mrcmi   0, 2, sp, cr3, cr13, {0}
0x00008dd8 <getopt+36>: eorvss  r3, r2, r1, lsl #6
0x00008ddc <getopt+40>: ldmvsda r6!, {r0, r1, r5, sp, lr}
0x00008de0 <getopt+44>: rsble   r2, r12, r10, lsr lr
0x00008de4 <getopt+48>: undefined
0x00008de8 <getopt+52>: undefined instruction 0xf0001c31
      ^^^^
0x00008dec <getopt+56>: stmcsda r0, {r0, r1, r4, r5, r7, r11, r12, sp,lr, pc}
0x00008df0 <getopt+60>: stmvcda r3, {r0, r2, r5, r6, r12, lr, pc}^
0x00008df4 <getopt+64>: eorles  r2, r12, r10, lsr r11
0x00008df8 <getopt+68>: movwcs  r4, #2636       ; 0xa4c
0x00008dfc <getopt+72>: stmvsda r3!, {r0, r1, r4, sp, lr}
0x00008e00 <getopt+76>: blcs    0x26e74
0x00008e04 <getopt+80>: bmi     0x12bd26c
0x00008e08 <getopt+84>: movwcc  r6, #6163       ; 0x1813
0x00008e0c <getopt+88>: ands    r6, r3, r3, lsl r0
0x00008e10 <getopt+92>: stcmil  12, cr4, [r7, #-268]
0x00008e14 <getopt+96>: andvs   r2, r11, r0, lsl #6
0x00008e18 <getopt+100>:        strmib  r6, [r10], -r9, lsr #16
0x00008e1c <getopt+104>:        ldmplia r11, {r0, r1, r3, r7}
0x00008e20 <getopt+108>:        strmi   r6, [r10, #35]
0x00008e24 <getopt+112>:        ldmvcda pc, {r2, r8, r10, r11, r12, lr,pc}
0x00008e28 <getopt+116>:        eorvs   r1, r2, r10, asr r12
0x00008e2c <getopt+120>:        andle   r2, r11, sp, lsr #30
0x00008e30 <getopt+124>:        eorvs   r4, r3, r0, asr #22
...

objdump shows:

00008db4 <_getopt>:
    8db4:       b5f0            push    {r4, r5, r6, r7, lr}
    8db6:       4657            mov     r7, sl
    8db8:       464e            mov     r6, r9
    8dba:       4645            mov     r5, r8
    8dbc:       b4e0            push    {r5, r6, r7}
    8dbe:       4689            mov     r9, r1
    8dc0:       4956            ldr     r1, [pc, #344]  (8f1c<_getopt+0x168>)
    8dc2:       680b            ldr     r3, [r1, #0]
    8dc4:       4682            mov     sl, r0
    8dc6:       4690            mov     r8, r2
    8dc8:       2b00            cmp     r3, #0
    8dca:       d121            bne     8e10 <_getopt+0x5c>
    8dcc:       4c54            ldr     r4, [pc, #336]  (8f20<_getopt+0x16c>)
    8dce:       6823            ldr     r3, [r4, #0]
    8dd0:       781a            ldrb    r2, [r3, #0]
    8dd2:       2a00            cmp     r2, #0
    8dd4:       d01d            beq     8e12 <_getopt+0x5e>
    8dd6:       4e53            ldr     r6, [pc, #332]  (8f24<_getopt+0x170>)
    8dd8:       3301            add     r3, #1
    8dda:       6032            str     r2, [r6, #0]
    8ddc:       6023            str     r3, [r4, #0]
    8dde:       6836            ldr     r6, [r6, #0]
    8de0:       2e3a            cmp     r6, #58
    8de2:       d06c            beq     8ebe <_getopt+0x10a>
    8de4:       4d50            ldr     r5, [pc, #320]  (8f28<_getopt+0x174>)
    8de6:       4640            mov     r0, r8
    8de8:       1c31            mov     r1, r6          (add r1, r6, #0)
    ^^^^
    8dea:       f8b3f000        bl      8f54 <_getopt+0x1a0>
    8dee:       2800            cmp     r0, #0
    8df0:       d065            beq     8ebe <_getopt+0x10a>
    8df2:       7843            ldrb    r3, [r0, #1]
    8df4:       2b3a            cmp     r3, #58


Home | Main Index | Thread Index | Old Index