gcc compile
Pierre Saucourt-Harmel (r54698)
pierre.saucourt-harmel@motorola.com
Fri Jan 19 02:58:00 GMT 2001
Jens-Christian Lache wrote:
> Hi! Do you know, what should I do if I want to use target
> simulator in arm-elf-gdb debugger?
> Normally I use have a monitor program,
> which handles software traps.
> Thatôs why the code crashes on the simulator.
Hi Jean-Christian.
To use the built-in gdb simulator for your arm-elf target, you have to remove all
your environment, use the default starting files provided by gcc and newlib
(crt0.o, crtbegin.o and crtend.o) and the simulator environment provided by gdb
(the simulator library for your target).
The main steps are :
1. Use the default crt0.o made by newlib (installed under "arm-elf/lib/" of your
installation directory).
2. Use the default crtbegin.o and crtend.o made by gcc (installed under
"lib/gcc-lib/arm-elf/2.95.2/" of your installation directory).
2. Use the default internal linker script of ld.
3. Link your program with libarm-elf-sim.a (delivered by GDB).
4. launch : arm-elf-gdb <your program>.
5. (gdb) target sim
(gdb) load <your program>
(gdb) run
To compile and link an hello_world.c for your arm-elf target :
arm-elf-gcc -g -c hello_world.c
arm-elf-gcc -L<your installation directory>/lib -larm-elf-sim -g hello_world.o -o
hello_world
Remark : You did not have to build your cross tools with specific flags.
Pierre.
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list