[uClinux-dev] Does ucfront work with libstdc++.a?

kitefree kitefree at so-net.net.tw
Sat Oct 20 07:57:23 EDT 2007


Hi,
Recently=20I=20have=20been=20working=20on=20c++=20program=20with=20uClinux-d=
ist.=20And=20I=20found
there=20seems=20to=20be=20some=20problem=20with=20using=20ucfront-g++=20with=
=20libstdc++.a(gcc=203.4.4).=20
As=20you=20can=20see=20how=20I=20build=20my=20C++=20program,
/home/nerokuo/uClinux/tools/ucfront-g++=20arm-linux-g++=20-D__PIC__=20-fpic=20=
-msingle-pic-base=20-msoft-float=20-Wall=20-c=20main.cpp
/home/nerokuo/uClinux/tools/ucfront-g++=20arm-linux-g++=20-L/home/nerokuo/uC=
linux/uClibc/lib=20-Wl,-elf2flt=20-Wl,--fatal-warnings=20-o=20helloworld=20m=
ain.o=20-msoft-float=20-lstdc++

After=20builing=20my=20program=20successfully.=20I=20run=20it=20on=20my=20ve=
rify=20board=20and=20it=20crashes
with=20this=20error=20when=20running=20at=20this=20line=20"test=20*p=20=3D=20=
new=20test(10);",
/mnt>=20./helloworld
BINFMT_FLAT:=20Loading=20file:=20./helloworld
Mapping=20is=205d0000,=20Entry=20point=20is=2044,=20data_start=20is=20b840
Load=20./helloworld:=20TEXT=3D5d0040-5db840=20DATA=3D1f0004-1f2234=20BSS=3D1=
f2234-1f6484
Unhandled=20fault:=20alignment=20exception=20(0x5000001)=20at=200x001b7fec
rld=201=20!Internal=20error:=20Oops:=205000001=20[#1]
CPU:=200
PC=20is=20at=200x5d89cc
LR=20is=20at=200x5d9334
pc=20:=20[<005d89cc>]=20=20=20=20lr=20:=20[<005d9334>]=20=20=20=20Not=20tain=
ted
sp=20:=20001f7ee8=20=20ip=20:=20001f7f60=20=20fp=20:=20001f7f5c
r10:=20005db840=20=20r9=20:=2000000000=20=20r8=20:=2000000000
r7=20:=2000000001=20=20r6=20:=20001f7f98=20=20r5=20:=20001f7f00=20=20r4=20:=20=
e1500003
r3=20:=2000000058=20=20r2=20:=2000009350=20=20r1=20:=20001f236a=20=20r0=20:=20=
001f7f00
Flags:=20nzCv=20=20IRQs=20on=20=20FIQs=20on=20=20Mode=20USER_32=20=20Segment=
=20kernel
Process=20helloworld=20(pid:=2018,=20stack=20limit=20=3D=200x001b6250)

And=20this=20is=20the=20main.cpp=20of=20my=20test=20program,
#include=20<stdio.h>
#include=20<unistd.h>

class=20test
{
public:
=20=20=20=20test(int=20n)=20{i=3Dn;}
=20=20=20=20int=20i;

};

int=20main(int=20argc,=20char=20*argv[])
{
=20=20=20=20test=20*p=20=3D=20new=20test(10);
=20=20=20=20printf("Nero:=20test=20=3D=20%d\n",=20p->i);
=20=20=20=20delete=20p;
=20=20=20=20return=200;
}

Could=20you=20help=20identify=20why=20this=20crash=20happens?=20Thanks=20a=20=
lot.

Nero


More information about the uClinux-dev mailing list