#19293 - KernelPanic26 - Fri Apr 16, 2004 10:13 am
Hi all !
I can't get my program to run with VBA (and any other emulator I hope) because I have a few code (0xFF bytes) that make the GBA to go into a protion of memory that don't exist : 0xezzzzzzz (z is any number in 0 - F ). I use gcc-3.3.2 (with soft-float activated), binutils-2.14 and newlib-1.12.0 running with linux. I've also tried to use devkitadvance binary for linux and it 's the same problem. Here is a partial disassembly of my code :
08000000 <__do_global_dtors_aux>:
8000000: e1a0c00d mov ip, sp
8000004: e92dd830 stmdb sp!, {r4, r5, fp, ip, lr, pc}
8000008: e59f5064 ldr r5, [pc, #100] ; 8000074 <__text_start+0x74>
800000c: e5d53000 ldrb r3, [r5]
8000010: e3530000 cmp r3, #0 ; 0x0
8000014: e24cb004 sub fp, ip, #4 ; 0x4
8000018: 191ba830 ldmnedb fp, {r4, r5, fp, sp, pc}
800001c: e59f4054 ldr r4, [pc, #84] ; 8000078 <__text_start+0x78>
8000020: e5943000 ldr r3, [r4]
8000024: e5932000 ldr r2, [r3]
8000028: e3520000 cmp r2, #0 ; 0x0
800002c: 0a000008 beq 8000054 <__text_start+0x54>
8000030: e5943000 ldr r3, [r4]
8000034: e2833004 add r3, r3, #4 ; 0x4
8000038: e5843000 str r3, [r4]
800003c: e1a0e00f mov lr, pc
8000040: e1a0f002 mov pc, r2
8000044: e5943000 ldr r3, [r4]
8000048: e5932000 ldr r2, [r3]
800004c: e3520000 cmp r2, #0 ; 0x0
8000050: 1afffff6 bne 8000030 <__text_start+0x30>
8000054: e59f3020 ldr r3, [pc, #32] ; 800007c <__text_start+0x7c>
8000058: e3530000 cmp r3, #0 ; 0x0
800005c: 159f001c ldrne r0, [pc, #28] ; 8000080 <__text_start+0x80>
8000060: 11a0e00f movne lr, pc
8000064: 11a0f003 movne pc, r3
8000068: e3a03001 mov r3, #1 ; 0x1
800006c: e5c53000 strb r3, [r5]
8000070: e91ba830 ldmdb fp, {r4, r5, fp, sp, pc}
8000074: 03000000 tsteq r0, #0 ; 0x0
8000078: 03000020 tsteq r0, #32 ; 0x20
800007c: 00000000 andeq r0, r0, r0
8000080: 0800040c stmeqda r0, {r2, r3, sl}
08000084 <call___do_global_dtors_aux>:
8000084: e1a0c00d mov ip, sp
8000088: e92dd800 stmdb sp!, {fp, ip, lr, pc}
800008c: e24cb004 sub fp, ip, #4 ; 0x4
8000090: e91ba800 ldmdb fp, {fp, sp, pc}
08000094 <frame_dummy>:
8000094: e59f3040 ldr r3, [pc, #64] ; 80000dc <frame_dummy+0x48>
8000098: e1a0c00d mov ip, sp
800009c: e3530000 cmp r3, #0 ; 0x0
80000a0: e92dd800 stmdb sp!, {fp, ip, lr, pc}
80000a4: e59f0034 ldr r0, [pc, #52] ; 80000e0 <frame_dummy+0x4c>
80000a8: e24cb004 sub fp, ip, #4 ; 0x4
80000ac: e59f1030 ldr r1, [pc, #48] ; 80000e4 <frame_dummy+0x50>
80000b0: 11a0e00f movne lr, pc
80000b4: 11a0f003 movne pc, r3
80000b8: e59f0028 ldr r0, [pc, #40] ; 80000e8 <frame_dummy+0x54>
80000bc: e5903000 ldr r3, [r0]
80000c0: e3530000 cmp r3, #0 ; 0x0
80000c4: 091ba800 ldmeqdb fp, {fp, sp, pc}
80000c8: e59f301c ldr r3, [pc, #28] ; 80000ec <frame_dummy+0x58>
80000cc: e3530000 cmp r3, #0 ; 0x0
80000d0: 091ba800 ldmeqdb fp, {fp, sp, pc}
80000d4: e91b6800 ldmdb fp, {fp, sp, lr}
80000d8: eaffffc8 b 8000000 <__text_start>
80000dc: 00000000 andeq r0, r0, r0
80000e0: 0800040c stmeqda r0, {r2, r3, sl}
80000e4: 03000004 tsteq r0, #4 ; 0x4
80000e8: 03000024 tsteq r0, #36 ; 0x24
80000ec: 00000000 andeq r0, r0, r0
080000f0 <call_frame_dummy>:
80000f0: e1a0c00d mov ip, sp
80000f4: e92dd800 stmdb sp!, {fp, ip, lr, pc}
80000f8: e24cb004 sub fp, ip, #4 ; 0x4
80000fc: e91ba800 ldmdb fp, {fp, sp, pc}
08000100 <_start>:
8000100: ea00002e b 80001c0 <rom_header_end>
...
80001b0: 00963130 addeqs r3, r6, r0, lsr r1
...
80001bc: 0000f000 andeq pc, r0, r0
080001c0 <rom_header_end>:
80001c0: ea000006 b 80001e0 <start_vector>
080001c4 <__boot_method>:
...
080001c5 <__slave_number>:
...
080001e0 <start_vector>:
80001e0: e3a00012 mov r0, #18 ; 0x12
80001e4: e129f000 msr CPSR_fc, r0
80001e8: e59fd0bc ldr sp, [pc, #188] ; 80002ac <CIDExit+0x2>
80001ec: e3a0001f mov r0, #31 ; 0x1f
80001f0: e129f000 msr CPSR_fc, r0
.....
What are these __do_global_dtors_aux, call___do_global_dtors_aux, call_frame_dummy and how can I remove then from generated .elf .
(I think this come from binutils' ld, but not sure)
If you can help me...
(sorry for maybe bad english)
I can't get my program to run with VBA (and any other emulator I hope) because I have a few code (0xFF bytes) that make the GBA to go into a protion of memory that don't exist : 0xezzzzzzz (z is any number in 0 - F ). I use gcc-3.3.2 (with soft-float activated), binutils-2.14 and newlib-1.12.0 running with linux. I've also tried to use devkitadvance binary for linux and it 's the same problem. Here is a partial disassembly of my code :
08000000 <__do_global_dtors_aux>:
8000000: e1a0c00d mov ip, sp
8000004: e92dd830 stmdb sp!, {r4, r5, fp, ip, lr, pc}
8000008: e59f5064 ldr r5, [pc, #100] ; 8000074 <__text_start+0x74>
800000c: e5d53000 ldrb r3, [r5]
8000010: e3530000 cmp r3, #0 ; 0x0
8000014: e24cb004 sub fp, ip, #4 ; 0x4
8000018: 191ba830 ldmnedb fp, {r4, r5, fp, sp, pc}
800001c: e59f4054 ldr r4, [pc, #84] ; 8000078 <__text_start+0x78>
8000020: e5943000 ldr r3, [r4]
8000024: e5932000 ldr r2, [r3]
8000028: e3520000 cmp r2, #0 ; 0x0
800002c: 0a000008 beq 8000054 <__text_start+0x54>
8000030: e5943000 ldr r3, [r4]
8000034: e2833004 add r3, r3, #4 ; 0x4
8000038: e5843000 str r3, [r4]
800003c: e1a0e00f mov lr, pc
8000040: e1a0f002 mov pc, r2
8000044: e5943000 ldr r3, [r4]
8000048: e5932000 ldr r2, [r3]
800004c: e3520000 cmp r2, #0 ; 0x0
8000050: 1afffff6 bne 8000030 <__text_start+0x30>
8000054: e59f3020 ldr r3, [pc, #32] ; 800007c <__text_start+0x7c>
8000058: e3530000 cmp r3, #0 ; 0x0
800005c: 159f001c ldrne r0, [pc, #28] ; 8000080 <__text_start+0x80>
8000060: 11a0e00f movne lr, pc
8000064: 11a0f003 movne pc, r3
8000068: e3a03001 mov r3, #1 ; 0x1
800006c: e5c53000 strb r3, [r5]
8000070: e91ba830 ldmdb fp, {r4, r5, fp, sp, pc}
8000074: 03000000 tsteq r0, #0 ; 0x0
8000078: 03000020 tsteq r0, #32 ; 0x20
800007c: 00000000 andeq r0, r0, r0
8000080: 0800040c stmeqda r0, {r2, r3, sl}
08000084 <call___do_global_dtors_aux>:
8000084: e1a0c00d mov ip, sp
8000088: e92dd800 stmdb sp!, {fp, ip, lr, pc}
800008c: e24cb004 sub fp, ip, #4 ; 0x4
8000090: e91ba800 ldmdb fp, {fp, sp, pc}
08000094 <frame_dummy>:
8000094: e59f3040 ldr r3, [pc, #64] ; 80000dc <frame_dummy+0x48>
8000098: e1a0c00d mov ip, sp
800009c: e3530000 cmp r3, #0 ; 0x0
80000a0: e92dd800 stmdb sp!, {fp, ip, lr, pc}
80000a4: e59f0034 ldr r0, [pc, #52] ; 80000e0 <frame_dummy+0x4c>
80000a8: e24cb004 sub fp, ip, #4 ; 0x4
80000ac: e59f1030 ldr r1, [pc, #48] ; 80000e4 <frame_dummy+0x50>
80000b0: 11a0e00f movne lr, pc
80000b4: 11a0f003 movne pc, r3
80000b8: e59f0028 ldr r0, [pc, #40] ; 80000e8 <frame_dummy+0x54>
80000bc: e5903000 ldr r3, [r0]
80000c0: e3530000 cmp r3, #0 ; 0x0
80000c4: 091ba800 ldmeqdb fp, {fp, sp, pc}
80000c8: e59f301c ldr r3, [pc, #28] ; 80000ec <frame_dummy+0x58>
80000cc: e3530000 cmp r3, #0 ; 0x0
80000d0: 091ba800 ldmeqdb fp, {fp, sp, pc}
80000d4: e91b6800 ldmdb fp, {fp, sp, lr}
80000d8: eaffffc8 b 8000000 <__text_start>
80000dc: 00000000 andeq r0, r0, r0
80000e0: 0800040c stmeqda r0, {r2, r3, sl}
80000e4: 03000004 tsteq r0, #4 ; 0x4
80000e8: 03000024 tsteq r0, #36 ; 0x24
80000ec: 00000000 andeq r0, r0, r0
080000f0 <call_frame_dummy>:
80000f0: e1a0c00d mov ip, sp
80000f4: e92dd800 stmdb sp!, {fp, ip, lr, pc}
80000f8: e24cb004 sub fp, ip, #4 ; 0x4
80000fc: e91ba800 ldmdb fp, {fp, sp, pc}
08000100 <_start>:
8000100: ea00002e b 80001c0 <rom_header_end>
...
80001b0: 00963130 addeqs r3, r6, r0, lsr r1
...
80001bc: 0000f000 andeq pc, r0, r0
080001c0 <rom_header_end>:
80001c0: ea000006 b 80001e0 <start_vector>
080001c4 <__boot_method>:
...
080001c5 <__slave_number>:
...
080001e0 <start_vector>:
80001e0: e3a00012 mov r0, #18 ; 0x12
80001e4: e129f000 msr CPSR_fc, r0
80001e8: e59fd0bc ldr sp, [pc, #188] ; 80002ac <CIDExit+0x2>
80001ec: e3a0001f mov r0, #31 ; 0x1f
80001f0: e129f000 msr CPSR_fc, r0
.....
What are these __do_global_dtors_aux, call___do_global_dtors_aux, call_frame_dummy and how can I remove then from generated .elf .
(I think this come from binutils' ld, but not sure)
If you can help me...
(sorry for maybe bad english)