This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
XScale Redboot C-runtime startup
- To: "'ecos-discuss at sourceware dot cygnus dot com'" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] XScale Redboot C-runtime startup
- From: "McAtee, Kip" <Kip dot McAtee at SpirentCom dot COM>
- Date: Mon, 25 Jun 2001 12:08:25 -1000
Greetings-
We're debugging on an XScale Cyclone board with Redboot.
When I link my 'app' with:
/usr/xscale-001130/H-i686-pc-cygwin/bin/xscale-elf-gcc -DDEBUG_PCI
-DCYGPKG_IO_P CI_DEBUG -Wall -Wpointer-arith -Wstrict-prototypes
-Winline -Wundef -Woverloaded -virtual -g -fno-rtti -fno-exceptions
-fvtable-gc -finit-priority -mapcs-frame - I../rb/inc
-L/usr/xscale-001130/H-i686-pc-cygwin/lib/gcc-lib/
xscale-elf/2.9-xscale-001130-specs=iq80310.specs
./objs/main.o
-o objs/test
and starting with a JTAG emulator from:
a0020000 <start>:
a0020000: e3a0b000 mov r11, #0 ; 0x0
a0020004: e3a07000 mov r7, #0 ; 0x0
a0020008: ea002e75 b a002b9e4 <c_start>
we find ourselves in bsp_trap, without calling main().
Where is the source to the following C runtime startup routines?
__do_global_ctors
__gccmain
c_start
_bsp_trap
Thanks-
Kip
============================
a002b948 <__do_global_ctors>:
a002b948: e92d4030 stmdb sp!, {r4, r5, lr}
a002b94c: e59f1060 ldr r1, [pc, #60] ; a002b9b4
<__do_global_ctors+0x6c>
a002b950: e5912000 ldr r2, [r1]
a002b954: e3720001 cmn r2, #1 ; 0x1
a002b958: 1a00000b bne a002b98c <__do_global_ctors+0x44>
a002b95c: e3a02000 mov r2, #0 ; 0x0
a002b960: e2820004 add r0, r2, #4 ; 0x4
a002b964: e7913000 ldr r3, [r1, r0]
a002b968: e1530002 cmp r3, r2
a002b96c: 0a000006 beq a002b98c <__do_global_ctors+0x44>
a002b970: e1a0c001 mov r12, r1
a002b974: e1a01000 mov r1, r0
a002b978: e2811004 add r1, r1, #4 ; 0x4
a002b97c: e79c3001 ldr r3, [r12, r1]
a002b980: e2822001 add r2, r2, #1 ; 0x1
a002b984: e3530000 cmp r3, #0 ; 0x0
a002b988: 1afffffa bne a002b978 <__do_global_ctors+0x30>
a002b98c: e2524000 subs r4, r2, #0 ; 0x0
a002b990: 0a000004 beq a002b9a8 <__do_global_ctors+0x60>
a002b994: e59f5018 ldr r5, [pc, #18] ; a002b9b4
<__do_global_ctors+0x6c>
a002b998: e1a0e00f mov lr, pc
a002b99c: e795f104 ldr pc, [r5, r4, lsl #2]
a002b9a0: e2544001 subs r4, r4, #1 ; 0x1
a002b9a4: 1afffffb bne a002b998 <__do_global_ctors+0x50>
a002b9a8: e59f0008 ldr r0, [pc, #8] ; a002b9b8
<__do_global_ctors+0x70>
a002b9ac: e8bd4030 ldmia sp!, {r4, r5, lr}
a002b9b0: ea0000d5 b a002bd0c <atexit>
a002b9b4: a002cd70 andge r12, r2, r0, ror sp
a002b9b8: a002b900 andge r11, r2, r0, lsl #18
a002b9bc <__gccmain>:
a002b9bc: e92d4000 stmdb sp!, {lr}
a002b9c0: e59f2018 ldr r2, [pc, #18] ; a002b9e0
<__gccmain+0x24>
a002b9c4: e5923000 ldr r3, [r2]
a002b9c8: e3530000 cmp r3, #0 ; 0x0
a002b9cc: 18bd8000 ldmneia sp!, {pc}
a002b9d0: e3a03001 mov r3, #1 ; 0x1
a002b9d4: e5823000 str r3, [r2]
a002b9d8: e49de004 ldr lr, [sp], #4
a002b9dc: eaffffd9 b a002b948 <__do_global_ctors>
a002b9e0: a0034000 andge r4, r3, r0
a002b9e4 <c_start>:
a002b9e4: e59f3090 ldr r3, [pc, #90] ; a002ba7c
<c_start+0x98>
a002b9e8: e59f0090 ldr r0, [pc, #90] ; a002ba80
<c_start+0x9c>
a002b9ec: e1a0c00d mov r12, sp
a002b9f0: e92dd800 stmdb sp!, {r11, r12, lr, pc}
a002b9f4: e1530000 cmp r3, r0
a002b9f8: e24cb004 sub r11, r12, #4 ; 0x4
a002b9fc: 0a000007 beq a002ba20 <c_start+0x3c>
a002ba00: e59f107c ldr r1, [pc, #7c] ; a002ba84
<c_start+0xa0>
a002ba04: e1a02003 mov r2, r3
a002ba08: e1520001 cmp r2, r1
a002ba0c: 2a000003 bcs a002ba20 <c_start+0x3c>
a002ba10: e4903004 ldr r3, [r0], #4
a002ba14: e4823004 str r3, [r2], #4
a002ba18: e1520001 cmp r2, r1
a002ba1c: 3afffffb bcc a002ba10 <c_start+0x2c>
a002ba20: e59f3060 ldr r3, [pc, #60] ; a002ba88
<c_start+0xa4>
a002ba24: e59f2060 ldr r2, [pc, #60] ; a002ba8c
<c_start+0xa8>
a002ba28: e1530002 cmp r3, r2
a002ba2c: 0a000004 beq a002ba44 <c_start+0x60>
a002ba30: 2a000003 bcs a002ba44 <c_start+0x60>
a002ba34: e3a01000 mov r1, #0 ; 0x0
a002ba38: e4831004 str r1, [r3], #4
a002ba3c: e1530002 cmp r3, r2
a002ba40: 3afffffc bcc a002ba38 <c_start+0x54>
a002ba44: e3a00cba mov r0, #47616 ; 0xba00
a002ba48: e59f1040 ldr r1, [pc, #40] ; a002ba90
<c_start+0xac>
a002ba4c: e28000ad add r0, r0, #173 ; 0xad
a002ba50: eb0000aa bl a002bd00 <_bsp_trap>
a002ba54: e92d0001 stmdb sp!, {r0}
a002ba58: e10f0000 mrs r0, CPSR
a002ba5c: e3c000c0 bic r0, r0, #192 ; 0xc0
a002ba60: e129f000 msr CPSR_fc, r0
a002ba64: e8bd0001 ldmia sp!, {r0}
a002ba68: e59f1024 ldr r1, [pc, #24] ; a002ba94
<c_start+0xb0>
a002ba6c: e3a00000 mov r0, #0 ; 0x0
a002ba70: e1a02001 mov r2, r1
a002ba74: ebffd164 bl a002000c <main>
a002ba78: eb0000c5 bl a002bd94 <exit>
a002ba7c: a0030000 andge r0, r3, r0
a002ba80: a0030000 andge r0, r3, r0
a002ba84: a0030800 andge r0, r3, r0, lsl #16
a002ba88: a0034000 andge r4, r3, r0
a002ba8c: a0034e90 mulge r3, r0, lr
a002ba90: a0034e84 andge r4, r3, r4, lsl #29
a002ba94: a00300c8 andge r0, r3, r8, asr #1