Re: undefined reference to __aeabi_unwind_cpp_pr1, __cxa_end_cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Thanks for the help.

> > The command I'm using is:
> > cross-gnueabi-g++ -static -nostartfiles -nodefaultlibs -nostdlib -T
> > temp.ld -o standalone_program start.o abc.o xyz.o -lgcc -lc
> > -L/tools/arm/gnu_crosstools/arm/lib/gcc/arm-linux-gnueabi/4.3.2/
>
> _aeabi_unwind_cpp_pr1 is normally defined in libgcc.  If the undefined
> reference is coming from libc, then you need to use -lgcc -lc -lgcc
> (and, yes, sometimes you need -lgcc -lc -lgcc -lc -lgcc, which you can
> also write as -Wl,--start-group,-lgcc,-lc,--end-group).

It still complains about _aeabi_unwind_cpp_pr1. If I use only -lgcc,
the linker complains about both  "_aeabi_unwind_cpp_pr1"
"__cxa_end_cleanup" as well as "memset". I added the -lc option to get
rid of the "memset" undefined reference error.

I've written custom functions to override the standard gcc functions
like strcmp, strcpy, free, malloc etc. The env the binary will run in
will not have the standard libraries available.

>
> __cxa_end_cleanup is normally defined lib libsupc++.  Since you are
> linking C++ code with -nodefaultlibs, you probably need an explicit
> -lsupc++.

When I add this option, it complains about many more standard symbols:
strlen, free, malloc, __aeabi_unwind_cpp_pr0, __cxa_pure_virtual etc.

JJ


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux