Hi,

I am trying to get a piece of software running on an ARM Evaluator board
without an operating system. I have been using Code Worrier and AXD from the
ARM Developer Suite as well as GNU GCC to do the development. Just to check
that the GNU cross compiler is working ok i wrote a simple 'Hello world'
program and compiled it using CodeWorrier and GCC. The CodeWorrier compiled
code works fine in AXD. It starts executing from location 0x8000 like it
should, prints to the console and exits properly.

The code genrated by GCC is very different. When i open the binary in AXD i
get a warning 'Code has no entry point'. It attempts to start executing from
0x0000 and the assembly looks very odd.

This is what the CodeWorrier binary looks like in AXD :

__main [0xe28f8090]   add      r8,pc,#0x90 ; #0x8098
00008004 [0xe898000f]   ldmia    r8,{r0-r3}
00008008 [0xe0800008]   add      r0,r0,r8
0000800c [0xe0811008]   add      r1,r1,r8
00008010 [0xe0822008]   add      r2,r2,r8
00008014 [0xe0833008]   add      r3,r3,r8
00008018 [0xe240b001]   sub      r11,r0,#1
0000801c [0xe242c001]   sub      r12,r2,#1
_move_region [0xe1500001]   cmp      r0,r1
00008024 [0x0a00000e]   beq      _zero_region
00008028 [0xe8b00070]   ldmia    r0!,{r4-r6}
0000802c [0xe1540005]   cmp      r4,r5
00008030 [0x0afffffa]   beq      _move_region
00008034 [0xe3140001]   tst      r4,#1
00008038 [0x1084400b]   addne    r4,r4,r11
0000803c [0xe3150001]   tst      r5,#1
00008040 [0x1085500b]   addne    r5,r5,r11
00008044 [0xe3150002]   tst      r5,#2
00008048 [0x10855009]   addne    r5,r5,r9
0000804c [0xe3c55003]   bic      r5,r5,#3
_move_loop [0xe2566004]   subs     r6,r6,#4
00008054 [0x24947004]   ldrcs    r7,[r4],#4
00008058 [0x24857004]   strcs    r7,[r5],#4
0000805c [0x8afffffb]   bhi      _move_loop
00008060 [0xeaffffee]   b        _move_region
_zero_region [0xe1520003]   cmp      r2,r3
00008068 [0x0b00038f]   bleq     __rt_entry
0000806c [0xe3a07000]   mov      r7,#0
00008070 [0xe8b20030]   ldmia    r2!,{r4,r5}
00008074 [0xe3140001]   tst      r4,#1
00008078 [0x1084400c]   addne    r4,r4,r12



And this is what the GCC binary looks like :



00000000 [0xe59ffa38]   ldr      pc,0x00000a40 ; = #0x00000b80
00000004 [0xe59ffa38]   ldr      pc,0x00000a44 ; = #0x00000b90
00000008 [0xe59ffa38]   ldr      pc,0x00000a48 ; = #0x00000ba0
0000000c [0xe59ffa38]   ldr      pc,0x00000a4c ; = #0x00000bb0
00000010 [0xe59ffa38]   ldr      pc,0x00000a50 ; = #0x00000bc0
00000014 [0xe59ffa38]   ldr      pc,0x00000a54 ; = #0x00000bd0
00000018 [0xe59ffa38]   ldr      pc,0x00000a58 ; = #0x00000be0
0000001c [0xe59ffa38]   ldr      pc,0x00000a5c ; = #0x00000bf0
00000020 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
00000024 [0xe800e800]   stmda    r0,{r11,r13-pc}
00000028 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
0000002c [0xe800e800]   stmda    r0,{r11,r13-pc}
00000030 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
00000034 [0xe800e800]   stmda    r0,{r11,r13-pc}
00000038 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
0000003c [0xe800e800]   stmda    r0,{r11,r13-pc}
00000040 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
00000044 [0xe800e800]   stmda    r0,{r11,r13-pc}
00000048 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
0000004c [0xe800e800]   stmda    r0,{r11,r13-pc}
00000050 [0xe7ff0010]   dci      0xe7ff0010 ; ? undefined
00000054 [0xe800e800]   stmda    r0,{r11,r13-pc}

This code doesn't seem to do anything intelligeble. Even if i scroll down to
location 0x8000 the same two instructions (stmda and dci) are still being
repeated.

The binary generated by GCC is a relacatable ELF right? So does it need to
be converted in some way so that it will be located to start at 0x8000?

Any help will be very welcome.
Gareth


_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
http://www.arm.linux.org.uk/armlinux/mailinglists.php
Please visit the above addresses for information on this list.

Reply via email to