I'm having troubles with C++ objects static constructors
when those are mapped after the 1st 128KB (basically this applies to any code that I wish to run before running the main).
It seems like the compiler is not able to use the "trampoline_jump" for those. When any of these functions reside outside the boundaries of the 128KB, the __do_global_ctors loop calls __tablejump_elpm__ which basically loads R31 and R30 with zeros and happily jumps to that.
Is there a work around?
I'd just need a way to instruct the compiler to put the program code of all these constructors in a separate section that I could just put that before the .text section..
Do you know of anything like this?
R