This is the mail archive of the ecos-discuss@sourceware.org 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]

Re: Problem with Hello world


On Thu, Apr 19, 2007 at 05:09:08PM +0200, LONY David wrote:
> 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

eCos 2.0 is very, very old. First i suggest you update to anoncvs.

     Andrew

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


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