This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Problem with Hello world
- From: LONY David <david dot lony at pragmadev dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 19 Apr 2007 17:09:08 +0200
- Subject: [ECOS] Problem with Hello world
Hi all,
I'm new to ecos and I've have some problem with the Hello World program
on Linux Synthetic Target (default template). I'm sucessfully compile
eCos on the configtool with these options :
-Wall -Wpointer-arith -Winline -Wundef -Woverloaded-virtual -g -O2
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc
for Global Compiler Flags
and
-g -nostdlib -Wl,--gc-sections -Wl,-static
for Global Linker Flags
then i compile a small program :
#include <stdio.h>
int main(void)
{
printf("Hello, eCos world!\n");
return 0;
}
like this : gcc -g -ILinux_install/include main.c -LLinux_install/lib
-Ttarget.ld -nostdlib
then I try to debug the final executable with gdb like that :
[lony@localhost eCOS_config]$ gdb
GNU gdb Red Hat Linux (6.3.0.0-1.21rh)
Copyright 2004 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 "i386-redhat-linux-gnu".
(gdb) file a.out
Reading symbols from /home/lony/eCOS_config/a.out...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) r
Starting program: /home/lony/eCOS_config/a.out
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xbb2000
Program received signal SIGSEGV, Segmentation fault.
0x0100bf46 in _memcpy (s1=0x0, s2=0x100ec68, n=18) at
/home/lony/ecos/ecos-2.0/packages/infra/v2_0/src/memcpy.c:165
165 *aligned_dst++ = *aligned_src++;
(gdb)
does I make something wrong ?
Thanks you
Best regards
David LONY
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss