MIPS little endian user space emulation
Hi,
anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu: unhandled CPU exception 0x1a - aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.
Seems to me that it gets a wrong jump address via gp in t9:
0x401fa00c: lw t9,-32600(gp)
...0x401fa01c: jalr t9
Any ideas?
Many thanks
Dirk
hello_world> cat hello_world.c
#include <stdio.h>
int main(void) {
printf("Hello world\n"); return 0;
}hello_world> mipsel-linux-gcc hello_world.c -o hello_worldhello_world> file hello_worldhello_world: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not stripped hello_world> ./qemu-mipsel -L /usr/mips/mipsel-linux/mipsel-linux -d out_asm,in_asm,op,int,exec,cpu hello_world
qemu: unhandled CPU exception 0x1a - aborting
pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00017864 a1 0001730c a2 000000a1 a3 00016500
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c00 t6 401f3f00 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 00012a2c k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3be8 s8 00000000 ra 401fa024
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000
Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000
CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT1: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT2: w:00000000 d:0000000000000000 fd:0 fs:5.75452
f00: w:00000000 d:0000000000000000 fd:0 fs:5.75452
...
f30: w:00000000 d:0000000000000000 fd:0 fs:5.75452
qemu: uncaught target signal 6 (Aborted) - exiting
Exctract of end of log file:
...
------------------------------------------------
pc=0x401f9c28 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 00000000 v1 00000008
GPR04: a0 00000008 a1 401f617c a2 401f3c38 a3 401f6000
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 6ffffe66 k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 6ffffeff
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000
Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000
CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:
0x401f9c28: lw v0,60(a2) 0x401f9c2c: nop 0x401f9c30: bnez v0,0x401fa000 0x401f9c34: nop
OP:0x0000: load_gpr_T0_gpr60x0001: set_T1 0x3c0x0002: add0x0003: lw_raw0x0004: store_T0_gpr_gpr20x0005: load_gpr_T0_gpr20x0006: reset_T10x0007: ne0x0008: set_bcond0x0009: jnz_T2 0x00x000a: goto_tb10x000b: save_pc 0x401f9c380x000c: set_T0 0x800cd4a10x000d: exit_tb0x000e: save_pc 0x401fa0000x000f: set_T0 0x00x0010: exit_tb0x0011: reset_T00x0012: exit_tb0x0013: end
---------------- 2 00000003
OUT: [size=80]
0x810cd980: mov 0x18(%ebp),%ebx 0x810cd983: mov $0x3c,%esi 0x810cd988: add %esi,%ebx 0x810cd98a: mov (%ebx),%ebx 0x810cd98c: mov %ebx,0x8(%ebp) 0x810cd98f: mov 0x8(%ebp),%ebx 0x810cd992: xor %esi,%esi 0x810cd994: cmp %esi,%ebx 0x810cd996: setne %al 0x810cd999: xor %ebx,%ebx 0x810cd99b: mov %al,%bl 0x810cd99d: mov %ebx,%edi 0x810cd99f: test %edi,%edi 0x810cd9a1: je 0x810cd9a8 0x810cd9a3: jmp 0x810cd9bd 0x810cd9a8: jmp 0x83151d34 0x810cd9ad: movl $0x401f9c38,0x80(%ebp) 0x810cd9b7: mov $0x800cd4a1,%ebx 0x810cd9bc: ret 0x810cd9bd: movl $0x401fa000,0x80(%ebp) 0x810cd9c7: mov $0x0,%ebx 0x810cd9cc: ret 0x810cd9cd: xor %ebx,%ebx 0x810cd9cf: ret
------------------------------------------------
pc=0x401fa000 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00000008 a1 401f617c a2 401f3c38 a3 401f6000
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 6ffffe66 k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 6ffffeff
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000
Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000
CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:
0x401fa000: lw a0,-32692(gp) 0x401fa004: lw a1,-32692(gp) 0x401fa008: lw a3,-32692(gp) 0x401fa00c: lw t9,-32600(gp) 0x401fa010: addiu a0,a0,30820 0x401fa014: addiu a1,a1,29452 0x401fa018: addiu a3,a3,25856 0x401fa01c: jalr t9 0x401fa020: li a2,161
OP:0x0000: load_gpr_T0_gpr280x0001: set_T1 0xffff804c0x0002: add0x0003: lw_raw0x0004: store_T0_gpr_gpr40x0005: load_gpr_T0_gpr280x0006: set_T1 0xffff804c0x0007: add0x0008: lw_raw0x0009: store_T0_gpr_gpr50x000a: load_gpr_T0_gpr280x000b: set_T1 0xffff804c0x000c: add0x000d: lw_raw0x000e: store_T0_gpr_gpr70x000f: load_gpr_T0_gpr280x0010: set_T1 0xffff80a80x0011: add0x0012: lw_raw0x0013: store_T0_gpr_gpr250x0014: load_gpr_T0_gpr40x0015: set_T1 0x78640x0016: add0x0017: store_T0_gpr_gpr40x0018: load_gpr_T0_gpr50x0019: set_T1 0x730c0x001a: add0x001b: store_T0_gpr_gpr50x001c: load_gpr_T0_gpr70x001d: set_T1 0x65000x001e: add0x001f: store_T0_gpr_gpr70x0020: load_gpr_T2_gpr250x0021: set_T0 0x401fa0240x0022: store_T0_gpr_gpr310x0023: reset_T00x0024: set_T1 0xa10x0025: add0x0026: store_T0_gpr_gpr60x0027: breg0x0028: reset_T00x0029: exit_tb0x002a: end
---------------- 2 00000003
OUT: [size=131]
0x810cd9d0: mov 0x70(%ebp),%ebx 0x810cd9d3: mov $0xffff804c,%esi 0x810cd9d8: add %esi,%ebx 0x810cd9da: mov (%ebx),%ebx 0x810cd9dc: mov %ebx,0x10(%ebp) 0x810cd9df: mov 0x70(%ebp),%ebx 0x810cd9e2: mov $0xffff804c,%esi 0x810cd9e7: add %esi,%ebx 0x810cd9e9: mov (%ebx),%ebx 0x810cd9eb: mov %ebx,0x14(%ebp) 0x810cd9ee: mov 0x70(%ebp),%ebx 0x810cd9f1: mov $0xffff804c,%esi 0x810cd9f6: add %esi,%ebx 0x810cd9f8: mov (%ebx),%ebx 0x810cd9fa: mov %ebx,0x1c(%ebp) 0x810cd9fd: mov 0x70(%ebp),%ebx 0x810cda00: mov $0xffff80a8,%esi 0x810cda05: add %esi,%ebx 0x810cda07: mov (%ebx),%ebx 0x810cda09: mov %ebx,0x64(%ebp) 0x810cda0c: mov 0x10(%ebp),%ebx 0x810cda0f: mov $0x7864,%esi 0x810cda14: add %esi,%ebx 0x810cda16: mov %ebx,0x10(%ebp) 0x810cda19: mov 0x14(%ebp),%ebx 0x810cda1c: mov $0x730c,%esi 0x810cda21: add %esi,%ebx 0x810cda23: mov %ebx,0x14(%ebp) 0x810cda26: mov 0x1c(%ebp),%ebx 0x810cda29: mov $0x6500,%esi 0x810cda2e: add %esi,%ebx 0x810cda30: mov %ebx,0x1c(%ebp) 0x810cda33: mov 0x64(%ebp),%edi 0x810cda36: mov $0x401fa024,%ebx 0x810cda3b: mov %ebx,0x7c(%ebp) 0x810cda3e: xor %ebx,%ebx 0x810cda40: mov $0xa1,%esi 0x810cda45: add %esi,%ebx 0x810cda47: mov %ebx,0x18(%ebp) 0x810cda4a: mov %edi,0x80(%ebp) 0x810cda50: xor %ebx,%ebx 0x810cda52: ret
------------------------------------------------
pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 401f60d4 v1 00000008
GPR04: a0 00017864 a1 0001730c a2 000000a1 a3 00016500
GPR08: t0 90000000 t1 401f6000 t2 40000000 t3 6fffffff
GPR12: t4 70000053 t5 401f3c20 t6 401f3f20 t7 00000063
GPR16: s0 6fffff72 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 6ffffdff t9 00012a2c k0 00000000 k1 00000000
GPR28: gp 40257020 sp 401f3c08 s8 00000000 ra 401fa024
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000
Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000
CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 cpu_mips_handle_mmu_fault pc 00012a2c ad 00012a2c rw 0 is_user 1 smmu 0do_raise_exception_err: 26 1
Quoted 8 lines · Dirk Behme
Hi,
anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu: unhandled CPU exception
0x1a- aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.
My CVS snapshot works:
$ mipsel-user/qemu-mipsel -L /nfsroot /nfsroot/bin/busybox ls / bin dev etc lib mnt proc sbin tmp usr
Stefan
Quoted 11 lines · Stefan Weil
Quoted 8 lines · Dirk Behme
Hi,
anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu: unhandled CPU exception
0x1a- aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.
Quoted 4 lines
My CVS snapshot works:
$ mipsel-user/qemu-mipsel -L /nfsroot /nfsroot/bin/busybox ls / bin dev etc lib mnt proc sbin tmp usr
Busybox statically or dynamically linked?
Which toolchain?
Dirk
Quoted 7 lines
Busybox statically or dynamically linked?
Which toolchain?
Dirk
Hello Dirk,
here is my working configuration:
host tools:
gcc-Version 3.3.6 (Debian 1:3.3.6-13)
cross tools (mipsel):
gcc with patches from OpenWrt: mipsel-linux-gcc (GCC) 3.4.5 (OpenWrt-2.0) GNU binutils version 2.16.1
busybox: BusyBox v1.1.2 (2006.04.24-20:20+0000) multi-call binary (dynamically linked)
uClib-3.4.5
Maybe you want to try your hello_world compiled with my toolchain? I send a binary with this mail (it is only 2 KB, so it should be ok for the list).
$ mipsel-linux-gcc hello_world.c -o hello_world $ file hello_world hello_world: ELF 32-bit LSB executable, MIPS, version 1 (SYSV), dynamically linked (uses shared libs), not stripped $ mipsel-user/qemu-mipsel -L /nfsroot.ok hello_world Hello world
Note the different output of the "file" command!
Regards
Stefan
Khi Thứ bảy 09 Tháng chín 2006 8:00 chiều, Stefan Weil viết:
Quoted 31 lines
Quoted 5 lines
Busybox statically or dynamically linked?
Which toolchain?
Dirk
Hello Dirk,
here is my working configuration:
host tools:
gcc-Version 3.3.6 (Debian 1:3.3.6-13)cross tools (mipsel):
gcc with patches from OpenWrt: mipsel-linux-gcc (GCC) 3.4.5 (OpenWrt-2.0) GNU binutils version 2.16.1
busybox: BusyBox v1.1.2 (2006.04.24-20:20+0000) multi-call binary (dynamically linked)
uClib-3.4.5Maybe you want to try your
hello_worldcompiled with my toolchain? I send a binary with this mail (it is only 2 KB, so it should be ok for the list).$ mipsel-linux-gcc hello_world.c -o hello_world $ file hello_world hello_world: ELF 32-bit LSB executable, MIPS, version 1 (SYSV), dynamically linked (uses shared libs), not stripped $ mipsel-user/qemu-mipsel -L /nfsroot.ok hello_world Hello world
Quoted 4 lines
Note the different output of the "file" command!
Regards
Stefan
hi stefan,
this is with uclibc ! (mine works too) but not with mipsel-glibc toolchain ! some people want glibc for more versatility maybe .
Khi Thứ sáu 08 Tháng chín 2006 6:35 chiều, Dirk Behme viết:
Quoted 320 lines
Hi,
anybody with success using little endian MIPS user space emulation qemu-mipsel? I try to run a simple hello world example using recent QEMU snapshot. It crashes with "qemu:
unhandled CPU exception0x1a- aborting". For more details see below. Doing the same with ARM compiler and qemu-arm does work btw.Seems to me that it gets a wrong jump address via gp in t9:
0x401fa00c: lw t9,-32600(gp)
...0x401fa01c: jalr t9Any ideas?
Many thanks
Dirk
hello_world> cathello_world.c
#include <stdio.h>int main(void) {
printf("Hello world\n");return 0; }
hello_world> mipsel-linux-gcchello_world.c-ohello_worldhello_world> filehello_worldhello_world: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), not strippedhello_world> ./qemu-mipsel -L/usr/mips/mipsel-linux/mipsel-linux-d out_asm,in_asm,op,int,exec,cpuhello_world
qemu: unhandled CPU exception0x1a- aborting pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0401f60d4v1 00000008
GPR04: a0 00017864 a10001730ca2000000a1a3 00016500
GPR08: t0 90000000 t1401f6000t2 40000000 t36fffffff
GPR12: t4 70000053 t5401f3c00t6401f3f00t7 00000063
GPR16: s06fffff72s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t86ffffdfft900012a2ck0 00000000 k1 00000000
GPR28: gp 40257020 sp401f3be8s8 00000000 ra401fa024
CP0 Status0x30400014Cause0x00000000EPC0x00000000Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000CP1 FCR0
0x00000110FCR310x00000000SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT1: w:00000000 d:0000000000000000 fd:0 fs:5.75452
FT2: w:00000000 d:0000000000000000 fd:0 fs:5.75452
f00: w:00000000 d:0000000000000000 fd:0 fs:5.75452
...
f30: w:00000000 d:0000000000000000 fd:0 fs:5.75452
qemu: uncaught target signal 6 (Aborted) - exitingExctract of end of log file:
...
------------------------------------------------
pc=0x401f9c28 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 00000000 v1 00000008
GPR04: a0 00000008 a1401f617ca2401f3c38a3401f6000
GPR08: t0 90000000 t1401f6000t2 40000000 t36fffffff
GPR12: t4 70000053 t5401f3c20t6401f3f20t7 00000063
GPR16: s06fffff72s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t86ffffdfft96ffffe66k0 00000000 k1 00000000
GPR28: gp 40257020 sp401f3c08s8 00000000 ra6ffffeff
CP0 Status0x30400014Cause0x00000000EPC0x00000000Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000CP1 FCR0
0x00000110FCR310x00000000SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:0x401f9c28: lw v0,60(a2) 0x401f9c2c: nop 0x401f9c30: bnez v0,0x401fa000 0x401f9c34: nopOP:
0x0000:load_gpr_T0_gpr60x0001:set_T10x3c0x0002: add0x0003:lw_raw0x0004:store_T0_gpr_gpr20x0005:load_gpr_T0_gpr20x0006:reset_T10x0007: ne0x0008:set_bcond0x0009:jnz_T20x00x000a:goto_tb10x000b:save_pc0x401f9c380x000c:set_T00x800cd4a10x000d:exit_tb0x000e:save_pc0x401fa0000x000f:set_T00x00x0010:exit_tb0x0011:reset_T00x0012:exit_tb0x0013: end---------------- 2 00000003
OUT: [size=80]0x810cd980: mov 0x18(%ebp),%ebx 0x810cd983: mov $0x3c,%esi 0x810cd988: add %esi,%ebx 0x810cd98a: mov (%ebx),%ebx 0x810cd98c: mov %ebx,0x8(%ebp) 0x810cd98f: mov 0x8(%ebp),%ebx 0x810cd992: xor %esi,%esi 0x810cd994: cmp %esi,%ebx 0x810cd996: setne %al 0x810cd999: xor %ebx,%ebx 0x810cd99b: mov %al,%bl 0x810cd99d: mov %ebx,%edi 0x810cd99f: test %edi,%edi 0x810cd9a1: je 0x810cd9a8 0x810cd9a3: jmp 0x810cd9bd 0x810cd9a8: jmp 0x83151d34 0x810cd9ad: movl $0x401f9c38,0x80(%ebp) 0x810cd9b7: mov $0x800cd4a1,%ebx 0x810cd9bc: ret 0x810cd9bd: movl $0x401fa000,0x80(%ebp) 0x810cd9c7: mov $0x0,%ebx 0x810cd9cc: ret 0x810cd9cd: xor %ebx,%ebx 0x810cd9cf: ret------------------------------------------------
pc=0x401fa000 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0401f60d4v1 00000008
GPR04: a0 00000008 a1401f617ca2401f3c38a3401f6000
GPR08: t0 90000000 t1401f6000t2 40000000 t36fffffff
GPR12: t4 70000053 t5401f3c20t6401f3f20t7 00000063
GPR16: s06fffff72s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t86ffffdfft96ffffe66k0 00000000 k1 00000000
GPR28: gp 40257020 sp401f3c08s8 00000000 ra6ffffeff
CP0 Status0x30400014Cause0x00000000EPC0x00000000Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000CP1 FCR0
0x00000110FCR310x00000000SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299 IN:0x401fa000: lw a0,-32692(gp) 0x401fa004: lw a1,-32692(gp) 0x401fa008: lw a3,-32692(gp) 0x401fa00c: lw t9,-32600(gp) 0x401fa010: addiu a0,a0,30820 0x401fa014: addiu a1,a1,29452 0x401fa018: addiu a3,a3,25856 0x401fa01c: jalr t9 0x401fa020: li a2,161OP:
0x0000:load_gpr_T0_gpr280x0001:set_T10xffff804c0x0002: add0x0003:lw_raw0x0004:store_T0_gpr_gpr40x0005:load_gpr_T0_gpr280x0006:set_T10xffff804c0x0007: add0x0008:lw_raw0x0009:store_T0_gpr_gpr50x000a:load_gpr_T0_gpr280x000b:set_T10xffff804c0x000c: add0x000d:lw_raw0x000e:store_T0_gpr_gpr70x000f:load_gpr_T0_gpr280x0010:set_T10xffff80a80x0011: add0x0012:lw_raw0x0013:store_T0_gpr_gpr250x0014:load_gpr_T0_gpr40x0015:set_T10x78640x0016: add0x0017:store_T0_gpr_gpr40x0018:load_gpr_T0_gpr50x0019:set_T10x730c0x001a: add0x001b:store_T0_gpr_gpr50x001c:load_gpr_T0_gpr70x001d:set_T10x65000x001e: add0x001f:store_T0_gpr_gpr70x0020:load_gpr_T2_gpr250x0021:set_T00x401fa0240x0022:store_T0_gpr_gpr310x0023:reset_T00x0024:set_T10xa10x0025: add0x0026:store_T0_gpr_gpr60x0027: breg0x0028:reset_T00x0029:exit_tb0x002a: end---------------- 2 00000003
OUT: [size=131]0x810cd9d0: mov 0x70(%ebp),%ebx 0x810cd9d3: mov $0xffff804c,%esi 0x810cd9d8: add %esi,%ebx 0x810cd9da: mov (%ebx),%ebx 0x810cd9dc: mov %ebx,0x10(%ebp) 0x810cd9df: mov 0x70(%ebp),%ebx 0x810cd9e2: mov $0xffff804c,%esi 0x810cd9e7: add %esi,%ebx 0x810cd9e9: mov (%ebx),%ebx 0x810cd9eb: mov %ebx,0x14(%ebp) 0x810cd9ee: mov 0x70(%ebp),%ebx 0x810cd9f1: mov $0xffff804c,%esi 0x810cd9f6: add %esi,%ebx 0x810cd9f8: mov (%ebx),%ebx 0x810cd9fa: mov %ebx,0x1c(%ebp) 0x810cd9fd: mov 0x70(%ebp),%ebx 0x810cda00: mov $0xffff80a8,%esi 0x810cda05: add %esi,%ebx 0x810cda07: mov (%ebx),%ebx 0x810cda09: mov %ebx,0x64(%ebp) 0x810cda0c: mov 0x10(%ebp),%ebx 0x810cda0f: mov $0x7864,%esi 0x810cda14: add %esi,%ebx 0x810cda16: mov %ebx,0x10(%ebp) 0x810cda19: mov 0x14(%ebp),%ebx 0x810cda1c: mov $0x730c,%esi 0x810cda21: add %esi,%ebx 0x810cda23: mov %ebx,0x14(%ebp) 0x810cda26: mov 0x1c(%ebp),%ebx 0x810cda29: mov $0x6500,%esi 0x810cda2e: add %esi,%ebx 0x810cda30: mov %ebx,0x1c(%ebp) 0x810cda33: mov 0x64(%ebp),%edi 0x810cda36: mov $0x401fa024,%ebx 0x810cda3b: mov %ebx,0x7c(%ebp) 0x810cda3e: xor %ebx,%ebx 0x810cda40: mov $0xa1,%esi 0x810cda45: add %esi,%ebx 0x810cda47: mov %ebx,0x18(%ebp) 0x810cda4a: mov %edi,0x80(%ebp) 0x810cda50: xor %ebx,%ebx 0x810cda52: ret------------------------------------------------
pc=0x00012a2c HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0401f60d4v1 00000008
GPR04: a0 00017864 a10001730ca2000000a1a3 00016500
GPR08: t0 90000000 t1401f6000t2 40000000 t36fffffff
GPR12: t4 70000053 t5401f3c20t6401f3f20t7 00000063
GPR16: s06fffff72s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t86ffffdfft900012a2ck0 00000000 k1 00000000
GPR28: gp 40257020 sp401f3c08s8 00000000 ra401fa024
CP0 Status0x30400014Cause0x00000000EPC0x00000000Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000CP1 FCR0
0x00000110FCR310x00000000SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT1: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
FT2: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f00: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f02: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f04: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f06: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f08: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f10: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f12: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f14: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f16: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f18: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f20: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f22: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f24: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f26: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f28: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299
f30: w:00000000 d:0000000000000000 fd:0 fs:-8.6795e-299cpu_mips_handle_mmu_faultpc00012a2cad00012a2crw 0is_user1 smmu 0do_raise_exception_err: 26 1
Quoted 4 lines
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
yes,I got similar error,but if I "static" compile then everything looks ok !
[sbox-mipselglibc: ~] > gcc /scratchbox/packages/hello.c -ohello -static [sbox-mipselglibc: ~] > qemu-mipsel hello
hello world
wangji@laixa:/scratchbox/users/wangji/targets/mipselglibc/bin$ file busybox busybox: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), for GNU/Linux 2.4.3, statically linked, stripped wangji@laixa:/scratchbox/users/wangji/targets/mipselglibc/bin$ qemu-mipsel busybox
BusyBox v1.00 (2006.08.27-10:16+0000) multi-call binary
Usage: busybox [function] [arguments]... ----cut here --
qemu-0.82 ,crosstool-0.38 from my latest livecdToolkit
http://mirror.opf.slu.cz/scratchbox/iso/ScratchboxMultiCpu-2.3.iso
Quoted 5 lines · wangji
Quoted 5 lines
Seems to me that it gets a wrong jump address via gp in t9:
0x401fa00c: lw t9,-32600(gp)
...0x401fa01c: jalr t9
...
Quoted 1 line
yes,I got similar error,but if I "static" compile then everything looks ok !
Thanks for the hint! static works for me as well.
So, maybe a toolchain (glibc?) issue?
Quoted 2 lines
qemu-0.82 ,crosstool-0.38 from my latest livecdToolkit
http://mirror.opf.slu.cz/scratchbox/iso/ScratchboxMultiCpu-2.3.iso
I use qemu-snapshot-2006-09-07_23 and toolchain created with crosstool-0.42 configuration
cat mipsel.dat gcc-3.4.1-glibc-2.3.2.dat
Regards
Dirk
Btw: Do you can connect and then step/continue with gdb to qemu-mipsel?
Khi Thứ bảy 09 Tháng chín 2006 9:16 Sáng, Dirk Behme viết:
Quoted 4 lines
Dirk
Btw: Do you can connect and then step/continue with gdb to qemu-mipsel?
alas ! no ! cont on gdb_session gives :
[sbox-mipselglibc: ~] > qemu-mipsel -g 1234 hello
qemu: unhandled CPU exception 0x10002 - aborting pc=0x004001a8 HI=0x00000000 LO=0x00000000 ds 0003 00000000 0
GPR00: r0 00000000 at 00000000 v0 00000000 v1 00000000
GPR04: a0 00000000 a1 00000000 a2 00000000 a3 00000000
GPR08: t0 00000000 t1 00000000 t2 00000000 t3 00000000
GPR12: t4 00000000 t5 00000000 t6 00000000 t7 00000000
GPR16: s0 00000000 s1 00000000 s2 00000000 s3 00000000
GPR20: s4 00000000 s5 00000000 s6 00000000 s7 00000000
GPR24: t8 00000000 t9 00000000 k0 00000000 k1 00000000
GPR28: gp 00000000 sp b7fcf7d0 s8 00000000 ra 004001a8
CP0 Status 0x30400014 Cause 0x00000000 EPC 0x00000000
Config0 0x80000082 Config1 0x1e190c8b LLAddr 0x00000000
CP1 FCR0 0x00000110 FCR31 0x00000000 SR.FR 0
FT0: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
FT1: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
FT2: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f00: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f02: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f04: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f06: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f08: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f10: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f12: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f14: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f16: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f18: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f20: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f22: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f24: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f26: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f28: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
f30: w:00000000 d:0000000000000000 fd:0 fs:4.89956e+164
qemu: uncaught target signal 6 (Aborted) - exiting
Quoted 8 lines
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
Khi Thứ bảy 09 Tháng chín 2006 9:16 Sáng, Dirk Behme viết:
Quoted 2 lines
So, maybe a toolchain (glibc?) issue?
you are certaily right,
doing the same "compile hello.c,and cont on gdb session " but with mipsel-uclibc works fine !!!
I did all that from my scratchboxmulticpu-2.3