CM3: C++ startup and linker infrastructure
Uwe Bonnes <bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org> Mon, 12 Dec 2016 11:33:44 +0100
| Newsgroups | gmane.comp.hardware.microcontrollers.ethernut |
|---|---|
| Message-ID | <[email protected]> |
Hallo, as Krzysztof pointed out, for CM3 code and linker commands where missing for C++ contructors. cppdemo was changed to show this behaviour. However this results in normal C programs to use 64 bytes more flash. For most devices this is not important, but a solution that would link __libc_init_array() only when needed would be welcome. One possibility would be, that we compile nutinit.c in the user Makefile with the appropriate compiler and the relevant code guarded with "#if defined(__cplusplus)". At the moment, we link with nutinit.o. B.t.w. what was the reason to link against nutinit.o and not put nutinit into the arch-library? Another possibility is a configuartor option that drops __libc_init_array() on request. But this makes the compiled libraries only usefull for C. Other ideas? @Krzysztof: I dropped __dso_handle for the moment. In my understanding, __dso_handle seems to related to destructors after main, something that is not needed in an embedded program. cppdemo compiles and runs fine w/o __dso_handle. If __dso_handle is still needed in some situations, cppdemo should be extended to show that requirement. Bye -- Uwe Bonnes bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 1623569 ------- Fax. 06151 1623305 --------- _______________________________________________ http://lists.egnite.de/mailman/listinfo/en-nut-discussion