Program received signal SIGTRAP, Trace/breakpoint trap while testing the arm elf
Hi,
iam a newbie to linux and crosscompilers. following are my C and assembly functions
#include <stdio.h>
void hello_asm(void);
void main()
{
printf("hello world");
hello_asm();
}
.global hello_asm
hello_asm:
PUSH {r4-r12,LR}
VLDMIA r2, {Q0}
POP {r4-r12,pc}
following are the commands used to compile and link.
mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-gcc -g -c main.c -o main.o
mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-as -mfpu=neon hello.s -o hello.o
mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-gcc -o mainelf main.o hello.o
Iam able to generate executable. when i try to execute this using gdb it is giving SIGTRAP.
following is the gdb log
mckala@mckala:~/crosstool-ng/crosstool-ng-1.6.1$ arm-unknown-eabi-gdb mainelf
GNU gdb (Linaro GDB) 7.2-2011.04-0
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_unknown-linux-gnu --target=arm-unknown-eabi".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/mckala/crosstool-ng/crosstool-ng-1.6.1/mainelf...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .init, size 0xc vma 0x8000
Loading section .text, size 0x4288 vma 0x800c
Loading section .fini, size 0xc vma 0xc294
Loading section .rodata, size 0xe8 vma 0xc2a0
Loading section .ARM.exidx, size 0x8 vma 0xc388
Loading section .eh_frame, size 0x4 vma 0xc390
Loading section .init_array, size 0x4 vma 0x14394
Loading section .fini_array, size 0x4 vma 0x14398
Loading section .jcr, size 0x4 vma 0x1439c
Loading section .data, size 0x9a0 vma 0x143a0
Start address 0x8061
Transfer rate: 158208 bits in <1 sec.
(gdb) b main
Breakpoint 1 at 0x8144: file main.c, line 8.
(gdb) run
Starting program: /home/mckala/crosstool-ng/crosstool-ng-1.6.1/mainelf
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00008066 in start ()
(gdb)
Can anyone please tell me where iam going wrong.
|