This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with simulator


Hi list
it is my first eMail and, I'm sure, simple for you.

I'm trying to load code into the simulator. I did so


this is the code hello.c
--------------------------------------------
/* this is a simple hello world program */
#include <stdio.h>

int main(void) {
 printf("Hello, eCos world!\n");
 return 0;
}
--------------------------------------------


then I have a make that does this
--------------------------------------------
v850-elf-gcc -c -o hello.o -g -O2  -Wall -I../install/include -ffunction-sections -fdata-sections  hello.c

v850-elf-gcc -nostartfiles -L../install/lib -Wl,--gc-sections -o hello hello.o -Ttarget.ld -nostdlib

v850-elf-objcopy -O srec hello hello.rec 
--------------------------------------------


The file are:
--------------------------------------------
-rwxr-xr-x    1 root     root       527265 mar 27 14:32 hello
-rw-r--r--    1 root     root          126 mar 27 10:21 hello.c
-rw-r--r--    1 root     root         5884 mar 27 14:32 hello.o
-rwxr-xr-x    1 root     root       138564 mar 27 14:32 hello.rec
--------------------------------------------


After I do
--------------------------------------------
v850-elf-gdb hello
	GNU gdb 5.2
	Copyright 2002 Free Software Foundation, Inc.
	GDB is free software, covered by the GNU General Public License, and you are
	welcome to change it and/or distribute copies of it under certain conditions.
	Type "show copying" to see the conditions.
	There is absolutely no warranty for GDB.  Type "show warranty" for details.
	This GDB was configured as "--host=i586-pc-linux-gnu --target=v850-elf"...

target sim
	Connected to the simulator.
load
	Loading section .text, size 0x98ac vma 0x205000
	Loading section .rodata, size 0x490 vma 0x20e8ac
	Loading section .data, size 0x1ef4 vma 0x20ed3c
	Start address 0x205000
	Transfer rate: 385408 bits in <1 sec.
run
	Starting program: /root/ecos/ecos-work-cris/hello
	core: 2 byte read to unmapped address 0x205000 at 0x205000
	
	Program received signal SIGSEGV, Segmentation fault.
	0x00205000 in start ()
	Current language:  auto; currently c++
--------------------------------------------


What I can do??????

Ciao

=========================================
 Ing. Cristoforo ABBATTISTA 
 Planetek Italia s.r.l.
 Via Massaua, 12   I-70123 Bari
 Tel.: +39 080 5343750  - Fax: +39 080 5340280
 cristoforo dot abbattista at planetek dot it
 Web: http://www.planetek.it


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]