Am Sonntag, den 21.10.2007, 10:57 +0200 schrieb Wolfgang Mües: > Erwin, > > On Samstag, 20. Oktober 2007, Erwin Authried wrote: > > It's generally true that you have to supply -fpic -msingle-pic-base > > to the linker. With the 3.4.4 snapgear toolchain, this won't help > > either, because the compilers libs are compiled without > > -msingle-pic-base. > > Ah. So he needs a new toolchain.... > > > There are other reasons why c++ won't work. As far > > as I remember, ucfront-g++ doesn't supply the right libraries for > > calling the constructors/destructors > > Yes, I know. I have had to find this out for myself 8-( > > > , and the elf2flt ld script is for old > > compilers with a different format of the ctor table. > > Can you elaborate on this one? > I am using 4.0.4. with the elf2flt script, and up to now, all c++ > programs behave. Can you tell me what is different for new compilers in > the linker script?
in elf2flt.ld, the ctor table starts with the nr. of entries in the table "LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)", and ends with 0. The newer compilers just have the ctor entries, and 0xffffffff as the end marker (if I remember correctly). The end marker isn't required in the ld script because it comes from the library. Because of the elf2flt.ld entries, you will see multiple definitions of the __CTOR_LIST__, __DTOR_LIST__ entries. It's possible that this doesn't cause any harm, but it's rather confusing, at least. The main problem with the 3.4 was the fact that the library for calling the ctors/dtors is compiled without -msingle-pic-base, causing a crash. Regards, Erwin _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
