CrossWorks for ARM V3 - New GCC Sections
I am currently upgrading our code base for CrossWorks for ARM V3.1 (with GCC 4.8).
This version of GCC has replaced the .ctors/.dtors sections for static constructor lists with .init_array/.fini_array (see here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770). However the default 'xxx_placement.xml' files supplied with CrossWorks (and installed into CrossWorks\targets) still use the old names - as does the default 'thumb_crt0.s'. This results in the static constructor lists missing from the compiled code.
We use our own placement file and thumb_crt0.s anyway which I have updated, but it would be nice if the basic ones that come with CrossWorks were correct. This took me several hours to work out as our code all built fine, but wouldn't run as the static constructors weren't getting called.
Cheers and Have a Good Day,
Wolfgang
-
This happened years ago.
The linker script generator works around it in th edefault case
else if (name==".dtors")
inputSections = "KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) KEEP (*(.fini_array .fini_array.*))";
else if (name==".ctors")
inputSections = "KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) KEEP (*(.init_array .init_array.*))";You would have problems if you have specified the input_sections in your placement file.
-
Thanks for that Michael.
Our company is not known for being fast-moving - in fact neither is our whole industry. We are just now in the process of upgrading from CrossWorks v2.1 to v3.
We had indeed specified the inputsections in our placement file (as our starting point was the one provided with the STM32 CPU Support Package v2.something). I have updated it to be the same as you have above - which of course means thumb_crt0.s doesn't need to change.
Thanks again for your help. Much appreciated.
Please sign in to leave a comment.
Comments
2 comments