Code size increase from version 2.0.11 to 2.2.0
I have a STM32 project which compiles in version 2.0.11 to a size of 32308 bytes. The same project compiles in version 2.2.0 to 34452 bytes. The code is optimized for size and is generated for THUMB Release with no debug info and has unused symbols stripped away. This 7% size increase just made my 32K flash overflow. Is this size increase related to the fact that I am using an evaluation license for version 2.2.0 or is the gcc in this version just generating worse size optimized code?
-
with 2.2 the library is managed differently and I got the whole of the c library included. To get rid of the unused functions I chagned project option/Build Options/enable Unused Symbol Removal to Yes.
When I did that I then lost a bunch of stuff as the linker couldn't figure out that my interrupt handlers were used (I don't use Rowley's default startup files), and then it also dropped statically invoked C++ constructors. I added all those back in via -u command line options (which I had enough of to use the Linker Options/Additional Linker Options From File feature). I had to use the mangled name for the C++ functions, which I got via using nm on the 2.0.11 version of the elf.
-
my previous post still didn't have things totally correct. I had to update my ld file with the contents that are generated by a build in the new system and then all my static constructors and isr functions and the like were included without forcing the linker with -u's (except my vector table is named differently and I had to deal with just that one item).
My previous post forced the constructors to exist, but statically called instances were not getting called.
Please sign in to leave a comment.
Comments
5 comments