Port-arm archive

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

Re: [PATCH] thumb fixes

On Fri, Sep 05, 2008 at 08:49:07AM +0300, Mikko Rapeli wrote:
> > Note that PLT sequences rely on the target
> > being either an ARM instruction or that the CPU running the code is v5t
> > or later (since ldr pc does not interwork correctly on v4t).
> I suppose netbsd defaults to v4t, so I hope -march=arm5t will fix this.

Nope, -march=armv5t didn't help.

SIGSEGV comes after this branch in main:

0x00008de0 <main+24>:   bl      0x8928 <warnx+12>

And the destination 0x8928 is the undefined instruction in the plt

gdb shows:

(gdb) disassemble 0x8928
No function contains specified address.
(gdb) x 0x8928
0x8928 <warnx+12>:      0x46c04778

objdump -D shows:

00008908 <.plt>:
    8908:       e52de004        str     lr, [sp, #-4]!
    890c:       e59fe004        ldr     lr, [pc, #4]    ; 8918 <.plt+0x10>
    8910:       e08fe00e        add     lr, pc, lr
    8914:       e5bef008        ldr     pc, [lr, #8]!
    8918:       000091b0        streqh  r9, [r0], -r0
    891c:       e28fc600        add     ip, pc, #0      ; 0x0
    8920:       e28cca09        add     ip, ip, #36864  ; 0x9000
    8924:       e5bcf1b0        ldr     pc, [ip, #432]!
    8928:       46c04778        undefined
    892c:       e28fc600        add     ip, pc, #0      ; 0x0
    8930:       e28cca09        add     ip, ip, #36864  ; 0x9000
    8934:       e5bcf1a4        ldr     pc, [ip, #420]!
    8938:       46c04778        undefined

If there only was a way to force the plt section to be in ARM mode...


Home | Main Index | Thread Index | Old Index