I have a source file that makes extensive use of templates. I also have explicit instances of different patterns in this file ... many of them. This file is compiled as part of the static library. I will compile this library on multiple platforms \ for multiple architectures: Win x86, Linux x86, and Linux ARM. For Linux collections, I use different compilers, so the resulting files (I say here in the context of the ELF file) are different: for GCC, the resulting object file is 8.4 MB in size and has a bit of more than 40,000 ELF sections; for the ARM compiler (armcc), the resulting file is 12.7 MB in size and has more than 90,000 ELF sections (!); in both cases I have debugging information.
What happens is that during the connection, the ARM linker suffocates and dies, trying to link to the huge object file in the static library. After some investigation, it seems that it cannot process object files with more than 65536 ELF sections in it (I still have confirmation from the compiler provider, though ... or am I doing something completely and completely wrong). The solution I found was splitting the file into several smaller files (this is the structure and what was allowed inside for this).
Question (s): is there any other alternative solution? Will it be possible for the compiler to generate additional code in the object file (in the context of the templates) before the binding phase?
source share