I have developed a MonoTouch iPhone application.
Currently it works by parsing a large amount of xml data that generates all of my objects.
I tried to improve the start speed by serialising these objects and storing in an sql lite database. But this was actually slower.
What I have done instead is to write a program that pre-parses this xml and in turn writes out class files that can simply be compiled and the objects instantiated at runtime.
This works and is a huge speed increase, but I can only compile a some of the set before the gcc compiler fails: I get a
“FATAL:Section too large, can’t encode r_address”
error where it can’t encode an address into 24-bits of scattered relocation entry
Can anyone shed some light on this for me please? I don’t understand compilers particularly but I would love to know if this is possible or if there’s something I am doing wrong.
Each and every individual class does compile, it is only when I compile a number of them that it fails.
There is no specific number of classes that causes it to fail, nor length of function, instead it seems to be caused by the sheer size of application code.
Thanks for your time,
Liam
This is already a known issue.
What you can do is to try to reduce the final size of your application. There are a couple of things you can do to try to reduce the application size:
Enable linking (project properties – iPhone Build – Linker behaviour: Link all assemblies)
Avoid generics with value types, since it will cause code to be emitted once per value type (so if you for instance use a
List<int>and aList<long>, the List code will be emitted twice – for bigger generic types this can make a big difference). Note that all class types will share the code (soList<string>andList<object>will use the same code), so use generics with class types freely.